*note: the coefficient estimates can vary slightly each time this code is run due to the lasso variable selection process (though we set seed directly) 

clear
set seed 1234

*put in your path
cd  "/Users/d31713r/Dropbox (Personal)/Voter fraud 2020 study/Data/Arizona replication/"

*requires installing cibar command and lean1 graph scheme
net describe cibar, from(http://fmwww.bc.edu/RePEc/bocode/c)
net install cibar.pkg

net describe gr0002, from(http://www.stata-journal.com/software/sj3-3)
net install gr0002.pkg

net describe vreverse, from(http://fmwww.bc.edu/RePEc/bocode/v)
net install vreverse.pkg

net sj 15-1 gr0059_1
net install gr0059_1.pkg

net describe st0085_2, from(http://www.stata-journal.com/software/sj14-2)
net install st0085_2.pkg, replace

*************
*2022 WAVE 1*
*************

use "DART0053_OUTPUT_updated.dta"

rename condition_treat condition_treat_w1

***Outcome Vars - PRE-TREATMENT***
*How many seats won by fraud in 2020*/
tab Q42a_w3 
rename Q42a_w3 seats_won_fraud_2020_w3
label var seats_won_fraud_2020_w3 "Number of Seats Won b/c Fraud 2020 - W3 PRE"
codebook seats_won_fraud_2020_w3

*How many seats will be won by fraud in 2022*
tab Q22b_w3 
rename Q22b_w3 seats_won_fraud_2022_w3
label var seats_won_fraud_2022_w3 "Number of Seats Will be Won b/c Fraud 2022 - W3 PRE"
codebook seats_won_fraud_2022_w3

*Biden rightful winner: four-point scale from definitely the rightful winner (4) to definitely not the rightful winner (1).
tab Q36_w3
vreverse Q36_w3, gen(biden_rwin_w3)
label var biden_rwin_w3 "Biden Rightful Winner W3 - PRE"
codebook biden_rwin_w3
tab biden_rwin_w3

*2020*
*Confidence your vote counted as intended: four-point scale from very confident (4) to not at all confident (1).
tab Q33_w3
rename Q33_w3 conf_yrvote_w3
label var conf_yrvote_w3 "Confidence Your Vote Counted as Intended 2020 - W3 - PRE"
codebook conf_yrvote_w3

*Confidence votes locally counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q32_w3
rename Q32_w3 conf_locvote_w3
label var conf_locvote_w3 "Confidence Votes Locally Counted as Intended 2020 - W3 - PRE"
codebook conf_locvote_w3

*Confidence votes state counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q31_w3
rename Q31_w3 conf_stvote_w3
label var conf_stvote_w3 "Confidence Votes in State Counted as Intended 2020 - W3 - PRE"
codebook conf_stvote_w3

*Confidence votes nationwide counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q30_w3
rename Q30_w3 conf_natlvote_w3
label var conf_natlvote_w3 "Confidence Votes Nationally Counted as Intended 2020 - W3 - PRE"
codebook conf_natlvote_w3

*Confidence in 2020 election scale: Mean of responses to four items (each measured 4=very confident to 1=not at all confident):
*-Your vote
*-Votes locally
*-Votes in your state
*-Votes nationwide
egen confidence_2020_w3=rowmean(conf_*)

*(All means will be calculated as the mean of answered items. We will verify that these items scale as a composite measure using principal components factor analysis. If they do not scale together, we will analyze them separately (as separate composite measures and/or individual outcome measures). If we analyze one or more composite measures, we will also report results separately for each dependent variable included in the composite measure(s) in the appendix. We may rescale scales to alternate ranges such as 0-1 for expositional reasons.)

factor conf_*, pcf

*2022*
*Confidence your vote will be counted as intended: four-point scale from very confident (4) to not at all confident (1).
tab Q22a_new1_w3
rename Q22a_new1_w3 conf_yrvote_2022_w3
label var conf_yrvote_2022_w3 "Confidence Your Vote Will Be Counted as Intended 2022 - W3 - PRE"
codebook conf_yrvote_2022_w3

*Confidence votes locally will be counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q22a_new2_w3
rename Q22a_new2_w3 conf_locvote_2022_w3
label var conf_locvote_2022_w3 "Confidence Votes Locally Will Be Counted as Intended 2022 - W3 - PRE"
codebook conf_locvote_2022_w3

*Confidence votes statewide will be counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q22a_new3_w3
rename Q22a_new3_w3 conf_stvote_2022_w3
label var conf_stvote_2022_w3 "Confidence Votes in State Will Be Counted as Intended 2022 - W3 - PRE"
codebook conf_stvote_2022_w3

*Confidence votes nationwide will be counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q22a_new4_w3
rename Q22a_new4_w3 conf_natlvote_2022_w3
label var conf_natlvote_2022_w3 "Confidence Votes Nationally Counted as Intended 2022 - W3 - PRE"
codebook conf_natlvote_2022_w3

*Confidence in 2022 election scale: Mean of responses to four items (each measured 4=very confident to 1=not at all confident):
*-Your vote
*-Votes locally
*-Votes in your state
*-Votes nationwide
egen confidence_2022_w3=rowmean(conf_yrvote_2022_w3 conf_locvote_2022_w3 conf_stvote_2022_w3 conf_natlvote_2022_w3)

factor conf_yrvote_2022_w3 conf_locvote_2022_w3 conf_stvote_2022_w3 conf_natlvote_2022_w3, pcf

**Voter Fraud 2020 Beliefs Frequency Scale - 2022 w3
/*Voter fraud in 2020 beliefs Frequency scale: Mean of responses to six items (each measured 7=a million or more to 1=less than ten):
-Voting more than once in an election.
-Stealing or tampering with ballots.
-Pretending to be someone else when voting.
-People voting who are not U.S. citizens.
-Voting with an absentee ballot intended for another person.
-Officials preventing absentee voters from voting.*/

tab q42_1_w3
vreverse q42_1_w3, gen(vf_doublevoting_w3)
label var vf_doublevoting_w3 "2020 VF Frequency - Double Voting - W3 - PRE"
codebook vf_doublevoting_w3

tab q42_2_w3
vreverse q42_2_w3, gen(vf_stealballots_w3)
label var vf_stealballots_w3 "2020 VF Frequency - Stealing/Tampering Ballots - W3 - PRE"
codebook vf_stealballots_w3

tab q42_3_w3
vreverse q42_2_w3, gen(vf_voterimpers_w3)
label var vf_voterimpers_w3 "2020 VF Frequency - Voter Impersonation - W3 - PRE"
codebook vf_voterimpers_w3

tab q42_4_w3
vreverse q42_4_w3, gen(vf_noncitz_voting_w3)
label var vf_noncitz_voting_w3 "2020 VF Frequency - Non-Citizen Voting - W3 - PRE"
codebook vf_noncitz_voting_w3

tab q42_5_w3
vreverse q42_5_w3, gen(vf_abstfraud_w3)
label var vf_abstfraud_w3 "2020 VF Frequency - Absentee Ballot Fraud - W3 - PRE"
codebook vf_abstfraud_w3
	
tab q42_6_w3
vreverse q42_6_w3, gen(vf_offic_fraud_w3)
label var vf_offic_fraud_w3 "2020 VF Frequency - Officials Preventing Absentee Vote - W3 - PRE"
codebook vf_offic_fraud_w3

*Voter fraud in 2020 beliefs Frequency scale: Mean of responses to six items (each measured 7=a million or more to 1=less than ten):
*-Voting more than once in an election.
*-Stealing or tampering with ballots.
*-Pretending to be someone else when voting.
*-People voting who are not U.S. citizens.
*-Voting with an absentee ballot intended for another person.
*-Officials preventing absentee voters from voting.
egen fraud2020w3_pre=rowmean(vf_doublevoting_w3 vf_stealballots_w3 vf_voterimpers_w3 vf_noncitz_voting_w3 vf_abstfraud_w3 vf_offic_fraud_w3)
codebook fraud2020w3_pre

factor vf_doublevoting_w3 vf_stealballots_w3 vf_voterimpers_w3 vf_noncitz_voting_w3 vf_abstfraud_w3 vf_offic_fraud_w3, pcf

**POST-TREATMENT**

*Biden rightful winner: four-point scale from definitely the rightful winner (4) to definitely not the rightful winner (1).
tab Q36_post_w3
vreverse Q36_post_w3, gen(biden_rwin_w3_post)
label var biden_rwin_w3_post "Biden Rightful Winner W3 - POST"
codebook biden_rwin_w3_post

*How many seats won by fraud in 2020*/
tab Q42a_post_w3 
rename Q42a_post_w3 seats_won_fraud_2020_w3_post
label var seats_won_fraud_2020_w3_post "Number of Seats Won b/c Fraud 2020 - W3 POST"
codebook seats_won_fraud_2020_w3_post

*How many seats will be won by fraud in 2022*
tab Q42c_w3 
rename Q42c_w3 seats_won_fraud_2022_w3_post
label var seats_won_fraud_2022_w3_post "Number of Seats Will Be Won b/c Fraud 2022 - W3 POST"
codebook seats_won_fraud_2022_w3_post

*2020*
*Confidence your vote counted as intended: four-point scale from very confident (4) to not at all confident (1).
tab Q33_post_w3
rename Q33_post_w3 conf_yrvote_w3_post
label var conf_yrvote_w3_post "Confidence Your Vote Counted as Intended 2020 - W3 - POST"
codebook conf_yrvote_w3_post

*Confidence votes locally counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q32_post_w3
rename Q32_post_w3 conf_locvote_w3_post
label var conf_locvote_w3_post "Confidence Votes Locally Counted as Intended 2020 - W3 - POST"
codebook conf_locvote_w3_post

*Confidence votes nationwide counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q31_post_w3
rename Q31_post_w3 conf_stvote_w3_post
label var conf_stvote_w3_post "Confidence Votes in State Counted as Intended 2020 - W3 - POST"
codebook conf_stvote_w3_post

*Confidence votes nationwide counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q30_post_w3
rename Q30_post_w3 conf_natlvote_w3_post
label var conf_natlvote_w3_post "Confidence Votes Nationally Counted as Intended 2020 - W3 - POST"
codebook conf_natlvote_w3_post

*Confidence in 2020 election scale: Mean of responses to four items (each measured 4=very confident to 1=not at all confident):
*-Your vote
*-Votes locally
*-Votes in your state
*-Votes nationwide
egen confidence_2020_w3_post=rowmean(conf_yrvote_w3_post conf_locvote_w3_post conf_stvote_w3_post conf_natlvote_w3_post)

factor conf_yrvote_w3_post conf_locvote_w3_post conf_stvote_w3_post conf_natlvote_w3_post, pcf

*2022*
*Confidence your vote will be counted as intended: four-point scale from very confident (4) to not at all confident (1).
tab Q42b_1new_w3
rename Q42b_1new_w3 conf_yrvote_2022_w3_post
label var conf_yrvote_2022_w3_post "Confidence Your Vote Will Be Counted as Intended 2022 - W3 - POST"
codebook conf_yrvote_2022_w3_post

*Confidence votes locally will be counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q42b_2new_w3
rename Q42b_2new_w3 conf_locvote_2022_w3_post
label var conf_locvote_2022_w3_post "Confidence Votes Locally Will Be Counted as Intended 2022 - W3 - POST"
codebook conf_locvote_2022_w3_post

*Confidence votes statewide will be counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q42b_3new_w3
rename Q42b_3new_w3 conf_stvote_2022_w3_post
label var conf_stvote_2022_w3_post "Confidence Votes in State Will Be Counted as Intended 2022 - W3 - POST"
codebook conf_stvote_2022_w3_post

*Confidence votes nationwide will be counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q42b_4new_w3
rename Q42b_4new_w3 conf_natlvote_2022_w3_post
label var conf_natlvote_2022_w3_post "Confidence Votes Nationally Will Be Counted as Intended 2022 - W3 - POST"
codebook conf_natlvote_2022_w3_post

*Confidence in 2022 election scale: Mean of responses to four items (each measured 4=very confident to 1=not at all confident):
*-Your vote
*-Votes locally
*-Votes in your state
*-Votes nationwide
egen confidence_2022_w3_post=rowmean(conf_yrvote_2022_w3_post conf_locvote_2022_w3_post conf_stvote_2022_w3_post conf_natlvote_2022_w3_post)

factor conf_yrvote_2022_w3_post conf_locvote_2022_w3_post conf_stvote_2022_w3_post conf_natlvote_2022_w3_post, pcf

**Voter Fraud 2020 Beliefs Frequency Scale - 2022 w3
/*Voter fraud in 2020 beliefs Frequency scale: Mean of responses to six items (each measured 7=a million or more to 1=less than ten):
-Voting more than once in an election.
-Stealing or tampering with ballots.
-Pretending to be someone else when voting.
-People voting who are not U.S. citizens.
-Voting with an absentee ballot intended for another person.
-Officials preventing absentee voters from voting.*/
tab q42_1_post_w3
vreverse q42_1_post_w3, gen(vf_doublevoting_w3_post)
label var vf_doublevoting_w3_post "2020 VF Frequency - Double Voting - W3 - POST"
codebook vf_doublevoting_w3_post

tab q42_2_post_w3
vreverse q42_2_post_w3, gen(vf_stealballots_w3_post)
label var vf_stealballots_w3_post "2020 VF Frequency - Stealing/Tampering Ballots - W3 - POST"
codebook vf_stealballots_w3_post

tab q42_3_post_w3
vreverse q42_2_post_w3, gen(vf_voterimpers_w3_post)
label var vf_voterimpers_w3_post "2020 VF Frequency - Voter Impersonation - W3 - POST"
codebook vf_voterimpers_w3_post

tab q42_4_post_w3
vreverse q42_4_post_w3, gen(vf_noncitz_voting_w3_post)
label var vf_noncitz_voting_w3_post "2020 VF Frequency - Non-Citizen Voting - W3 - POST"
codebook vf_noncitz_voting_w3_post

tab q42_5_post_w3
vreverse q42_5_post_w3, gen(vf_abstfraud_w3_post)
label var vf_abstfraud_w3_post "2020 VF Frequency - Absentee Ballot Fraud - W3 - POST"
codebook vf_abstfraud_w3_post
	
tab q42_6_post_w3
vreverse q42_6_post_w3, gen(vf_offic_fraud_w3_post)
label var vf_offic_fraud_w3_post "2020 VF Frequency - Officials Preventing Absentee Vote - W3 - POST"
codebook vf_offic_fraud_w3_post

*Voter fraud in 2020 beliefs Frequency scale: Mean of responses to six items (each measured 7=a million or more to 1=less than ten):
*-Voting more than once in an election.
*-Stealing or tampering with ballots.
*-Pretending to be someone else when voting.
*-People voting who are not U.S. citizens.
*-Voting with an absentee ballot intended for another person.
*-Officials preventing absentee voters from voting.
egen fraud2020w3_post=rowmean(vf_doublevoting_w3_post vf_stealballots_w3_post vf_voterimpers_w3_post vf_noncitz_voting_w3_post vf_abstfraud_w3_post vf_offic_fraud_w3_post)
codebook fraud2020w3_post 

factor vf_doublevoting_w3_post vf_stealballots_w3_post vf_voterimpers_w3_post vf_noncitz_voting_w3_post vf_abstfraud_w3_post vf_offic_fraud_w3_post, pcf

***Predictors
** Inoculation Condition 
tab Q1_C1_w3 count_c1_q1, cell /*94% correct first time*/
tab Q2_C1_w3 count_c1_q2, cell /*94% correct first time*/
tab Q3_C1_w3 count_c1_q3, cell /*81% correct first time*/
tab Q4_C1_w3 count_c1_q4, cell /*87% correct first time*/

gen num_correct_first_inoc=(Q1_C1_w3==1 & count_c1_q1==1) + (Q2_C1_w3==1 & count_c1_q2==1) + (Q3_C1_w3==1 & count_c1_q3==1) + (Q4_C1_w3==1 & count_c1_q4==1) if condition_treat==1 
tab num_correct_first_inoc

gen inoculation=(condition_treat==1)
label var inoculation "Prebunking"
codebook inoculation

** Fact Check Condition
tab Q1_C2_w3 count_c2_q1, cell /*91% correct first time*/
tab Q2_C2_w3 count_c2_q2, cell /*89% correct first time*/
tab Q3_C2_w3 count_c2_q3, cell /*97% correct first time*/
tab Q4_C2_w3 count_c2_q4, cell /*80% correct first time*/

gen num_correct_first_corr=(Q1_C2_w3==1 & count_c2_q1==1) + (Q2_C2_w3==1 & count_c2_q2==1) + (Q3_C2_w3==1 & count_c2_q3==1) + (Q4_C2_w3==1 & count_c2_q4==1) if condition_treat==2
tab num_correct_first_corr

gen correction=(condition_treat==2)
label var correction "Correction"
codebook correction

** Placebo Condition
tab Q1_C3_w3 /*99.8%*/
tab Q2_C3_w3 /*99.7%*/
tab Q3_C3_w3 /*99*/
tab Q4_C3_w3 /*99.9%*/

**Democrat
*Democrat: 1 if respondent self-identifies as a Democrat or leans toward the Democratic Party, 0 if they do not lean toward either party, lean Republican, or self-identify as a Republican.
tab pid7
recode pid7 (1/3=1 "Democrat") (4/8=0 "Non-Democrat") (.=.), gen(democrat_w3)
label var democrat_w3 "Democrat Dummy"
codebook democrat_w3

**Republican 

*Republican: 1 if respondent self-identifies as a Republican or leans toward the Republican Party, 0 if they do not lean toward either party, lean Democrat, or self-identify as a Democrat.
recode pid7 (1/4 8 = 0 "Non-Republican") (5/7=1 "Republican") (.=.), gen(republican_w3)
label var republican_w3 "Republican Dummy"
codebook republican_w3

gen independent_w3=.
replace independent_w3=0 if pid7!=4 & pid7!=. & pid7!=8
replace independent_w3=1 if pid7==4 | pid7==8

*PID 3-Point

*Three-point party ID scale: Democrats including leaners (1), true independents (2), Republicans including leaners (3).
recode pid7 (1/3=1 "Democrats") (4=2 "Independents") (5/7=3 "Republicans") (8=.) (.=.), gen(pid3_recode_w3)
label var pid3_recode_w3 "PID 3-Pt (Recode from PID7)"
codebook pid3_recode_w3

** quietly lasso variables

*Education (college vs. non-college)
codebook educ
gen college_w3=(educ==5 | educ==6) if educ!=.
codebook college_w3

*Age group (18-34, 35-44, 45-54, 55-64, 65+)
codebook age
gen age1834=(age>=18 & age<=34)
gen age3544=(age>=35 & age<=44)
gen age4554=(age>=45 & age<=54)
gen age5564=(age>=55 & age<=64)
gen age65plus=(age>=65 & age!=.)
codebook age*

gen agegroup=.
replace agegroup=1 if age1834==1
replace agegroup=2 if age3544==1
replace agegroup=3 if age4554==1
replace agegroup=4 if age5564==1
replace agegroup=5 if age65plus==1

label def agelab 1 "18-34" 2 "35-44" 3 "45-54" 4 "55-64" 5 "65+"
label val agegroup agelab

*Male (1/0)
codebook gender
gen male=(gender==1) if gender!=.
codebook male

*Region (Northeast, South, Midwest, West)
codebook region
gen northeast=(region==1) if region!=.
gen midwest=(region==2) if region!=.
gen south=(region==3) if region!=.
gen west=(region==4) if region!=.

*Party ID (three-point)
*made above

*Ideological self-placement (seven-point) 
replace ideo5=. if ideo5==6 
rename ideo5 ideo5_w3
**DEVIATION: five-point not seven

*Conspiracy predispositions (mean: 1-5)
*Conspiracy predispositions: Mean of responses to 4 items (each measured 5=strongly agree to 1=strongly disagree):
*-"Much of our lives are being controlled by plots hatched in secret places."
*-"Even though we live in a democracy, a few people will always run things anyway."
*-"The people who really `run' the country are not known to voters."
*-"Big events like wars, recessions, and the outcomes of elections are controlled by small groups of people who are working in secret against the rest of us."
codebook q21_*
vreverse q21_1_w3, gen(conspiracy1)
vreverse q21_2_w3, gen(conspiracy2)
vreverse q21_3_w3, gen(conspiracy3)
vreverse q21_4_w3, gen(conspiracy4)
codebook conspir*
egen conspiracy=rowmean(conspiracy1-conspiracy4)
codebook conspiracy

*Political knowledge: Number of correct responses to 5 items (0-5):
*-"For how many years is a United States Senator elected - that is, how many years are there in one full term of oﬃce for a U.S. Senator?" (response options: Two years, Four years, Six years, Eight years, None of these, Don't know)
*-"How many times can an individual be elected President of the United States under current laws?  [Response options: Once, Twice, Four times, Unlimited number of terms, Don't know]
*-"How many U.S. Senators are there from each state?" (response options: One, Two, Four, Depends on which state, Don't know)
*-"Who is currently the Prime Minister of the United Kingdom?" (response options: Richard Branson, Liz Truss, David Cameron, Theresa May, Margaret Thatcher, Don't know)
*-"For how many years is a member of the United States House of Representatives elected - that is, how many years are there in one full term of office for a U.S. House member?" (response options: Two years, Four years, Six years, Eight years, For life, Don't know)
codebook Q6_w3 Q7_w3 Q8_w3 Q9_w3x Q10_w3
gen knowledge=(Q6_w3==3)+(Q7_w3==2)+(Q8_w3==2)+(Q9_w3==1)+(Q10_w3==1)
codebook knowledge

*Nonwhite (1/0)
gen nonwhite_w3=(race!=1) if race!=.

*Interest in politics (1-5)
codebook Q3_w3 
vreverse Q3_w3, gen(polinterest)
codebook polinterest

*Media and information trust: Mean of responses to four items (each 1=not at all and 4=a lot) 
*How much, if at all, do you trust the information you get from …
*-National news organizations 
*-Local news organizations
*-Social media (such as Facebook, Twitter, and Instagram)
*-Political leaders in the federal government
*-Political leaders in the state government 
codebook q22*
vreverse q22_1_w3, gen(mediatrust1)
vreverse q22_2_w3, gen(mediatrust2)
vreverse q22_3_w3, gen(mediatrust3)
vreverse q22_4_w3, gen(mediatrust4)
vreverse q22_5_w3, gen(mediatrust5)
egen mediatrust=rowmean(mediatrust1-mediatrust5)
codebook mediatrust

*Biden rightful winner (1-4)
*made above

*Seats changed in 2020 (1-4)
*made above

*Seats changed in 2022 (1-4)
*made above

*Fraud prevalence 2020 (mean: 1-7)
*made above

*Confidence in 2020 election (mean: 1-4)
*made above

*Confidence in 2022 election (mean: 1-4)
*made above

*Feelings toward Joe Biden (0-100)
codebook q14_w3
gen bidentherm=q14_w3

*Feelings toward Donald Trump (0-100)
codebook q13_w3
gen trumptherm=q13_w3

*Feelings toward Democrats (0-100)
codebook q11_w3
gen demtherm=q11_w3

*Feelings toward Republicans (0-100)
codebook q12_w3
gen reptherm=q12_w3

*Feelings toward news media (0-100)
codebook q15_w3
gen mediatherm=q15_w3

*Feelings toward election officials (0-100)
codebook q16_w3
gen electionofficialtherm=q16_w3

*Feelings toward white people (0-100)
codebook q18_w3
gen whitetherm=q18_w3

*Feelings toward Black people (0-100)
codebook q17_w3
gen blacktherm=q17_w3

*college
gen college=(educ==5 | educ==6) if educ!=.
gen noncollege=(educ<5) if educ!=.

label def noncollegelab 0 "College degree" 1 "No college degree"
label val noncollege noncollegelab

*demos
tab educ
tab gender
tab pid7
tab race
su birthyr, detail

gen white=(race==1) if race!=.

label def nonwhitelab 0 "White" 1 "Non-white"
label val nonwhite_w3 nonwhitelab

gen party3=.
replace party3=1 if pid7<4
replace party3=2 if pid7==4 | pid7==8
replace party3=3 if pid7>4 & pid7<8

label def partylab 1 "Democrat" 2 "Independent" 3 "Republican"
label val party3 partylab

gen condition=0
replace condition=1 if correction==1
replace condition=2 if inoculation==1

gen female=abs(male-1)

label var agegroup "Age group"
label var noncollege "Education"
label var nonwhite_w3 "Race"
label var party3 "Party (with leaners)"

dtable i.gender i.agegroup i.noncollege i.nonwhite_w3 i.party3, by(condition) export(study1-descriptives.tex, replace) fvlabel

xtile trumpq=trumptherm, nq(3)

*forcing these into groups of 3
xtile conf2020q=confidence_2020_w3, nq(4)
xtile conf2022q=confidence_2022_w3, nq(4)

xtile fraud2020q_w3=fraud2020w3_pre, nq(3)

save "2022w1.dta", replace

*************
*2022 WAVE 2*
*************

***YG 2022 - W2 (W4 overall)***
**January 2023**

clear

use "DART0053_W2_OUTPUT.dta"

***Outcome Vars - PRE-TREATMENT***
*How many seats won by fraud in 2020*/
tab Q42a_w4 
rename Q42a_w4 seats_won_fraud_2020_w4
label var seats_won_fraud_2020_w4 "Number of Seats Won b/c Fraud 2020 - W4 PRE"
codebook seats_won_fraud_2020_w4

*How many seats will be won by fraud in 2022*
tab Q22b_w4 
rename Q22b_w4 seats_won_fraud_2022_w4
label var seats_won_fraud_2022_w4 "Number of Seats Will be Won b/c Fraud 2022 - W4 PRE"
codebook seats_won_fraud_2022_w4

*Biden rightful winner: four-point scale from definitely the rightful winner (4) to definitely not the rightful winner (1).
tab Q36_w4
vreverse Q36_w4, gen(biden_rwin_w4)
label var biden_rwin_w4 "Biden Rightful Winner W4 - PRE"
codebook biden_rwin_w4

*2020*
*Confidence your vote counted as intended: four-point scale from very confident (4) to not at all confident (1).
tab Q33_w4
rename Q33_w4 conf_yrvote_w4
label var conf_yrvote_w4 "Confidence Your Vote Counted as Intended 2020 - w4 - PRE"
codebook conf_yrvote_w4

*Confidence votes locally counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q32_w4
rename Q32_w4 conf_locvote_w4
label var conf_locvote_w4 "Confidence Votes Locally Counted as Intended 2020 - w4 - PRE"
codebook conf_locvote_w4

*Confidence votes state counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q31_w4
rename Q31_w4 conf_stvote_w4
label var conf_stvote_w4 "Confidence Votes in State Counted as Intended 2020 - w4 - PRE"
codebook conf_stvote_w4

*Confidence votes nationwide counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q30_w4
rename Q30_w4 conf_natlvote_w4
label var conf_natlvote_w4 "Confidence Votes Nationally Counted as Intended 2020 - w4 - PRE"
codebook conf_natlvote_w4

*Confidence in 2020 election scale: Mean of responses to four items (each measured 4=very confident to 1=not at all confident):
*-Your vote
*-Votes locally
*-Votes in your state
*-Votes nationwide
egen confidence_2020_w4=rowmean(conf_*)

*(All means will be calculated as the mean of answered items. We will verify that these items scale as a composite measure using principal components factor analysis. If they do not scale together, we will analyze them separately (as separate composite measures and/or individual outcome measures). If we analyze one or more composite measures, we will also report results separately for each dependent variable included in the composite measure(s) in the appendix. We may rescale scales to alternate ranges such as 0-1 for expositional reasons.)

factor conf_*, pcf

*2022*
*Confidence your vote will be counted as intended: four-point scale from very confident (4) to not at all confident (1).
tab Q22a_1_w4
rename Q22a_1_w4 conf_yrvote_2022_w4
label var conf_yrvote_2022_w4 "Confidence Your Vote Will Be Counted as Intended 2022 - w4 - PRE"
codebook conf_yrvote_2022_w4

*Confidence votes locally will be counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q22a_2_w4
rename Q22a_2_w4 conf_locvote_2022_w4
label var conf_locvote_2022_w4 "Confidence Votes Locally Will Be Counted as Intended 2022 - w4 - PRE"
codebook conf_locvote_2022_w4

*Confidence votes statewide will be counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q22a_3_w4
rename Q22a_3_w4 conf_stvote_2022_w4
label var conf_stvote_2022_w4 "Confidence Votes in State Will Be Counted as Intended 2022 - w4 - PRE"
codebook conf_stvote_2022_w4

*Confidence votes nationwide will be counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q22a_4_w4
rename Q22a_4_w4 conf_natlvote_2022_w4
label var conf_natlvote_2022_w4 "Confidence Votes Nationally Counted as Intended 2022 - w4 - PRE"
codebook conf_natlvote_2022_w4

*Confidence in 2022 election scale: Mean of responses to four items (each measured 4=very confident to 1=not at all confident):
*-Your vote
*-Votes locally
*-Votes in your state
*-Votes nationwide
egen confidence_2022_w4=rowmean(conf_yrvote_2022_w4 conf_locvote_2022_w4 conf_stvote_2022_w4 conf_natlvote_2022_w4)

factor conf_yrvote_2022_w4 conf_locvote_2022_w4 conf_stvote_2022_w4 conf_natlvote_2022_w4, pcf

**Voter Fraud 2020 Beliefs Frequency Scale - 2022 w4
/*Voter fraud in 2020 beliefs Frequency scale: Mean of responses to six items (each measured 7=a million or more to 1=less than ten):
-Voting more than once in an election.
-Stealing or tampering with ballots.
-Pretending to be someone else when voting.
-People voting who are not U.S. citizens.
-Voting with an absentee ballot intended for another person.
-Officials preventing absentee voters from voting.*/

tab Q42_1_w4
vreverse Q42_1_w4, gen(vf_doublevoting_w4)
label var vf_doublevoting_w4 "2020 VF Frequency - Double Voting - w4 - PRE"
codebook vf_doublevoting_w4

tab Q42_2_w4
vreverse Q42_2_w4, gen(vf_stealballots_w4)
label var vf_stealballots_w4 "2020 VF Frequency - Stealing/Tampering Ballots - w4 - PRE"
codebook vf_stealballots_w4

tab Q42_3_w4
vreverse Q42_2_w4, gen(vf_voterimpers_w4)
label var vf_voterimpers_w4 "2020 VF Frequency - Voter Impersonation - w4 - PRE"
codebook vf_voterimpers_w4

tab Q42_4_w4
vreverse Q42_4_w4, gen(vf_noncitz_voting_w4)
label var vf_noncitz_voting_w4 "2020 VF Frequency - Non-Citizen Voting - w4 - PRE"
codebook vf_noncitz_voting_w4

tab Q42_5_w4
vreverse Q42_5_w4, gen(vf_abstfraud_w4)
label var vf_abstfraud_w4 "2020 VF Frequency - Absentee Ballot Fraud - w4 - PRE"
codebook vf_abstfraud_w4
	
tab Q42_6_w4
vreverse Q42_6_w4, gen(vf_offic_fraud_w4)
label var vf_offic_fraud_w4 "2020 VF Frequency - Officials Preventing Absentee Vote - w4 - PRE"
codebook vf_offic_fraud_w4

*Voter fraud in 2020 beliefs Frequency scale: Mean of responses to six items (each measured 7=a million or more to 1=less than ten):
*-Voting more than once in an election.
*-Stealing or tampering with ballots.
*-Pretending to be someone else when voting.
*-People voting who are not U.S. citizens.
*-Voting with an absentee ballot intended for another person.
*-Officials preventing absentee voters from voting.
egen fraud2020w4_pre=rowmean(vf_doublevoting_w4 vf_stealballots_w4 vf_voterimpers_w4 vf_noncitz_voting_w4 vf_abstfraud_w4 vf_offic_fraud_w4)
codebook fraud2020w4_pre

factor vf_doublevoting_w4 vf_stealballots_w4 vf_voterimpers_w4 vf_noncitz_voting_w4 vf_abstfraud_w4 vf_offic_fraud_w4, pcf

*ceilings and floors
tab confidence_2020_w4
tab confidence_2022_w4
tab seats_won_fraud_2020_w4
tab seats_won_fraud_2022_w4
tab fraud2020w4_pre

**POST-TREATMENT**

*Biden rightful winner: four-point scale from definitely the rightful winner (4) to definitely not the rightful winner (1).
tab Q36_post_w4
vreverse Q36_post_w4, gen(biden_rwin_w4_post)
label var biden_rwin_w4_post "Biden Rightful Winner w4 - POST"
codebook biden_rwin_w4_post

*How many seats won by fraud in 2020*/
tab Q42a_post_w4 
rename Q42a_post_w4 seats_won_fraud_2020_w4_post
label var seats_won_fraud_2020_w4_post "Number of Seats Won b/c Fraud 2020 - POST"
codebook seats_won_fraud_2020_w4_post

*How many seats will be won by fraud in 2022*
tab Q42c_w4 
rename Q42c_w4 seats_won_fraud_2022_w4_post
label var seats_won_fraud_2022_w4_post "Number of Seats Will Be Won b/c Fraud 2022 - POST"
codebook seats_won_fraud_2022_w4_post

*2020*
*Confidence your vote counted as intended: four-point scale from very confident (4) to not at all confident (1).
tab Q33_post_w4
rename Q33_post_w4 conf_yrvote_w4_post
label var conf_yrvote_w4_post "Confidence Your Vote Counted as Intended 2020 - w4 - POST"
codebook conf_yrvote_w4_post

*Confidence votes locally counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q32_post_w4
rename Q32_post_w4 conf_locvote_w4_post
label var conf_locvote_w4_post "Confidence Votes Locally Counted as Intended 2020 - w4 - POST"
codebook conf_locvote_w4_post

*Confidence votes nationwide counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q31_post_w4
rename Q31_post_w4 conf_stvote_w4_post
label var conf_stvote_w4_post "Confidence Votes in State Counted as Intended 2020 - w4 - POST"
codebook conf_stvote_w4_post

*Confidence votes nationwide counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q30_post_w4
rename Q30_post_w4 conf_natlvote_w4_post
label var conf_natlvote_w4_post "Confidence Votes Nationally Counted as Intended 2020 - w4 - POST"
codebook conf_natlvote_w4_post

*Confidence in 2020 election scale: Mean of responses to four items (each measured 4=very confident to 1=not at all confident):
*-Your vote
*-Votes locally
*-Votes in your state
*-Votes nationwide
egen confidence_2020_w4_post=rowmean(conf_yrvote_w4_post conf_locvote_w4_post conf_stvote_w4_post conf_natlvote_w4_post)

factor conf_yrvote_w4_post conf_locvote_w4_post conf_stvote_w4_post conf_natlvote_w4_post, pcf

*2022*
*Confidence your vote will be counted as intended: four-point scale from very confident (4) to not at all confident (1).
tab Q42b_1_w4
rename Q42b_1_w4 conf_yrvote_2022_w4_post
label var conf_yrvote_2022_w4_post "Confidence Your Vote Will Be Counted as Intended 2022 - w4 - POST"
codebook conf_yrvote_2022_w4_post

*Confidence votes locally will be counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q42b_2_w4
rename Q42b_2_w4 conf_locvote_2022_w4_post
label var conf_locvote_2022_w4_post "Confidence Votes Locally Will Be Counted as Intended 2022 - w4 - POST"
codebook conf_locvote_2022_w4_post

*Confidence votes statewide will be counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q42b_3_w4
rename Q42b_3_w4 conf_stvote_2022_w4_post
label var conf_stvote_2022_w4_post "Confidence Votes in State Will Be Counted as Intended 2022 - w4 - POST"
codebook conf_stvote_2022_w4_post

*Confidence votes nationwide will be counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q42b_4_w4
rename Q42b_4_w4 conf_natlvote_2022_w4_post
label var conf_natlvote_2022_w4_post "Confidence Votes Nationally Will Be Counted as Intended 2022 - w4 - POST"
codebook conf_natlvote_2022_w4_post

*Confidence in 2022 election scale: Mean of responses to four items (each measured 4=very confident to 1=not at all confident):
*-Your vote
*-Votes locally
*-Votes in your state
*-Votes nationwide
egen confidence_2022_w4_post=rowmean(conf_yrvote_2022_w4_post conf_locvote_2022_w4_post conf_stvote_2022_w4_post conf_natlvote_2022_w4_post)

factor conf_yrvote_2022_w4_post conf_locvote_2022_w4_post conf_stvote_2022_w4_post conf_natlvote_2022_w4_post, pcf

**Voter Fraud 2020 Beliefs Frequency Scale - 2022 w4
/*Voter fraud in 2020 beliefs Frequency scale: Mean of responses to six items (each measured 7=a million or more to 1=less than ten):
-Voting more than once in an election.
-Stealing or tampering with ballots.
-Pretending to be someone else when voting.
-People voting who are not U.S. citizens.
-Voting with an absentee ballot intended for another person.
-Officials preventing absentee voters from voting.*/
tab Q42_1_post_w4
vreverse Q42_1_post_w4, gen(vf_doublevoting_w4_post)
label var vf_doublevoting_w4_post "2020 VF Frequency - Double Voting - w4 - POST"
codebook vf_doublevoting_w4_post

tab Q42_2_post_w4
vreverse Q42_2_post_w4, gen(vf_stealballots_w4_post)
label var vf_stealballots_w4_post "2020 VF Frequency - Stealing/Tampering Ballots - w4 - POST"
codebook vf_stealballots_w4_post

tab Q42_3_post_w4
vreverse Q42_2_post_w4, gen(vf_voterimpers_w4_post)
label var vf_voterimpers_w4_post "2020 VF Frequency - Voter Impersonation - w4 - POST"
codebook vf_voterimpers_w4_post

tab Q42_4_post_w4
vreverse Q42_4_post_w4, gen(vf_noncitz_voting_w4_post)
label var vf_noncitz_voting_w4_post "2020 VF Frequency - Non-Citizen Voting - w4 - POST"
codebook vf_noncitz_voting_w4_post

tab Q42_5_post_w4
vreverse Q42_5_post_w4, gen(vf_abstfraud_w4_post)
label var vf_abstfraud_w4_post "2020 VF Frequency - Absentee Ballot Fraud - w4 - POST"
codebook vf_abstfraud_w4_post
	
tab Q42_6_post_w4
vreverse Q42_6_post_w4, gen(vf_offic_fraud_w4_post)
label var vf_offic_fraud_w4_post "2020 VF Frequency - Officials Preventing Absentee Vote - w4 - POST"
codebook vf_offic_fraud_w4_post

*Voter fraud in 2020 beliefs Frequency scale: Mean of responses to six items (each measured 7=a million or more to 1=less than ten):
*-Voting more than once in an election.
*-Stealing or tampering with ballots.
*-Pretending to be someone else when voting.
*-People voting who are not U.S. citizens.
*-Voting with an absentee ballot intended for another person.
*-Officials preventing absentee voters from voting.
egen fraud2020w4_post=rowmean(vf_doublevoting_w4_post vf_stealballots_w4_post vf_voterimpers_w4_post vf_noncitz_voting_w4_post vf_abstfraud_w4_post vf_offic_fraud_w4_post)
codebook fraud2020w4_post 

factor vf_doublevoting_w4_post vf_stealballots_w4_post vf_voterimpers_w4_post vf_noncitz_voting_w4_post vf_abstfraud_w4_post vf_offic_fraud_w4_post, pcf

***Arizona/Maricopa county questions

*pre-experiment AZ awareness

*To the best of your knowledge, which of these states has had a losing candidate for governor refuse to accept the results of the 2022 election?
codebook Q22a_5_w4
recode Q22a_5_w4 (1=1 "Correct (Arizona)") (2/6=0 "Not Correct"), gen(azgovelect_knowl)
label var azgovelect_knowl "AZ Gov Election Knowledge"
codebook azgovelect_knowl
tab azgovelect_knowl /*76%*/

/* Arizona votes counted as intended */
*"How confident are you that votes in Arizona have been counted as voters intended in the November 2022 election?" (Recoded so higher values are more confident)
gen AZconfidence_w4=Q43_w4
recode AZconfidence (4=1) (3=2) (2=3) (1=4)

/* Maricopa County

On Election Day, a printing malfunction took place at about one-quarter of the polling places in Maricopa County, the most populous county in Arizona. This problem stopped some ballots from being counted onsite.
 
Please indicate whether you believe the following statement is accurate or not.
Only voting sites in conservative areas in Arizona's Maricopa County experienced issues with tabulating ballots on Election Day. */

*Statement/answer categories are worded such that saying "accurate" is a misperception, so coding is flipped so that the a fact-checking intervention that works would be negative (it reduces misperceptions) to avoid weird conflation of accuracy of underlying claim with "accurate" in answer categories 

gen AZmaricopa_w4=Q44_w4
recode AZmaricopa_w4 (4=1) (3=2) (2=3) (1=4)

/* Katie Hobbs won due to fraud */

*In the election for Arizona governor, Katie Hobbs, the Democrat, defeated Kari Lake, the Republican, due to election fraud and is NOT the rightful winner.

*Statement/answer categories are worded such that saying "agree" is a misperception, so coding is flipped so that the a fact-checking intervention that works would be negative (it reduces misperceptions) to be avoid switching signs from previous question 

gen AZgov_rightful_w4=Q45_w4
recode AZgov_rightful_w4 (4=1) (3=2) (2=3) (1=4)

***Predictors

** Factcheck Condition 
tab count_Q23_fact_check_w4_pg if fact_check_treat==1 /*89.3% correct first time*/
tab fail_Q23_fact_check_w4_3times if fact_check_treat==1 /*1.0% fail 3x*/
tab Q23_fact_check_w4 /*see above*/

gen factcheck_w4=(fact_check_treat==1)
label var factcheck_w4 "Factcheck Treatment Dummy"
codebook factcheck_w4

** Placebo Condition
tab count_placebo_Q_w4_pg if fact_check_treat==2 /*96.9% correct first time*/
tab fail_placebo_Q_w4_3times if fact_check_treat==2 /*.14% fail 3x*/
tab placebo_Q_w4 /*see above*/

**Democrat
*Democrat: 1 if respondent self-identifies as a Democrat or leans toward the Democratic Party, 0 if they do not lean toward either party, lean Republican, or self-identify as a Republican.
tab pid7
recode pid7 (1/3=1 "Democrat") (4/8=0 "Non-Democrat") (.=.), gen(democrat_w4)
label var democrat_w4 "Democrat Dummy"
codebook democrat_w4

**Republican 

*Republican: 1 if respondent self-identifies as a Republican or leans toward the Republican Party, 0 if they do not lean toward either party, lean Democrat, or self-identify as a Democrat.
recode pid7 (1/4 8 = 0 "Non-Republican") (5/7=1 "Republican") (.=.), gen(republican_w4)
label var republican_w4 "Republican Dummy"
codebook republican_w4

*PID 3-Point

*Three-point party ID scale: Democrats including leaners (1), true independents (2), Republicans including leaners (3).
recode pid7 (1/3=1 "Democrats") (4=2 "Independents") (5/7=3 "Republicans") (8=.) (.=.), gen(pid3_recode_w4)
label var pid3_recode_w4 "PID 3-Pt (Recode from PID7)"
codebook pid3_recode_w4

** quietly lasso variables

*Party ID (three-point)
*made above

**DEVIATION: five-point not seven

*Biden rightful winner (1-4)
*made above

*Seats changed in 2020 (1-4)
*made above

*Seats changed in 2022 (1-4)
*made above

*Fraud prevalence 2020 (mean: 1-7)
*made above

*Confidence in 2020 election (mean: 1-4)
*made above

*Confidence in 2022 election (mean: 1-4)
*made above

*Feelings toward Joe Biden (0-100)
codebook Q14_w4
gen bidentherm_w4=Q14_w4

*Feelings toward Donald Trump (0-100)
codebook Q13_w4
gen trumptherm_w4=Q13_w4

*Feelings toward Democrats (0-100)
codebook Q11_w4
gen demtherm_w4=Q11_w4

*Feelings toward Republicans (0-100)
codebook Q12_w4
gen reptherm_w4=Q12_w4

*Feelings toward news media (0-100)
codebook Q15_w4
gen mediatherm_w4=Q15_w4

*Feelings toward election officials (0-100)
codebook Q16_w4
gen electionofficialtherm_w4=Q16_w4

*Feelings toward white people (0-100)
codebook Q18_w4
gen whitetherm_w4=Q18_w4

*Feelings toward Black people (0-100)
codebook Q17_w4
gen blacktherm_w4=Q17_w4

*Voted in 2022
codebook Q23_w4
recode Q23_w4 (4=1 "Voted") (1/3=0 "Did Not Vote"), gen(turnout_dum_2022)
label var turnout_dum_2022 "2022 Turnout Dummy"
codebook turnout_dum_2022

*demos
tab educ
tab gender
tab pid7
tab race
su birthyr, detail

rename caseid caseid_orig
rename caseid_DART0053_W1 caseid 
merge 1:1 caseid using "2022w1.dta"
tab _merge

*quietly lasso covariates will be selected separately for each outcome, including separately when an outcome is measured in multiple waves. The set of candidate covariates in the list above will always be used. When a covariate has been measured in multiple waves, we will use the most recent pre-treatment measure of the covariate in the model in question (where "pre-treatment" is defined with respect to the treatment variable(s) in the model being estimated).

*H3: Exposure to a correction treatment debunking false claims about election fraud in Arizona (compared to a placebo condition) will reduce false beliefs that issues tabulating ballots in Maricopa County were only experienced at voting sites in conservative areas (H3a) and that Katie Hobbs won the gubernatorial election due to election fraud and is not the rightful winner (H3b).

*H3a: Maricopa misperceptions = B0 + B1*w2_correction + B2*w1_correction + B3*w1_inoculation + quietly lasso controls

quietly lasso linear AZmaricopa_w4 college age3544 age4554 age5564 age65plus male midwest south west pid3_recode_w3 ideo5 conspiracy knowledge nonwhite polinterest mediatrust biden_rwin_w3 seats_won_fraud_2020_w3 seats_won_fraud_2022_w3 fraud2020w3_pre confidence_2020_w3 confidence_2022_w3 bidentherm trumptherm demtherm reptherm mediatherm electionofficialtherm whitetherm blacktherm, rseed(1234)
local AZmaricopa_w4_ctl=e(allvars_sel) 

reg AZmaricopa_w4 factcheck_w4 correction inoculation `AZmaricopa_w4_ctl', robust
est store maricopa

reg AZmaricopa_w4 factcheck_w4 correction inoculation, robust
est store maricopa_noc

bysort factcheck_w4: su AZmaricopa_w4

*H3b: Hobbs won due to fraud = B0 + B1*w2_correction + B2*w1_correction + B3*w1_inoculation + quietly lasso controls

quietly lasso linear AZgov_rightful_w4 college age3544 age4554 age5564 age65plus male midwest south west pid3_recode_w3 ideo5 conspiracy knowledge nonwhite polinterest mediatrust biden_rwin_w3 seats_won_fraud_2020_w3 seats_won_fraud_2022_w3 fraud2020w3_pre confidence_2020_w3 confidence_2022_w3 bidentherm trumptherm demtherm reptherm mediatherm electionofficialtherm whitetherm blacktherm, rseed(1234)
local AZgov_rightful_ctl=e(allvars_sel) 

reg AZgov_rightful_w4 factcheck_w4 correction inoculation `AZgov_rightful_ctl', robust
est store AZright

reg AZgov_rightful_w4 factcheck_w4 correction inoculation, robust
est store AZright_noc

bysort factcheck_w4: su AZgov_rightful_w4

*RQ5a: Will exposure to a correction treatment debunking false claims about election fraud in Arizona (compared to a placebo condition) affect confidence in the 2022 election and beliefs about the prevalence and effects of fraud (Frequency of voter fraud and the number of seats changed by fraud) in the 2022 election?

*RQ5a: Confidence in 2022 vote = B0 + B1*w2_correction + B2*w1_correction + B3*w1_inoculation + quietly lasso controls
*2022 fraud prevalence = B0 + B1*w2_correction + B2*w1_correction + B3*w1_inoculation + quietly lasso controls
*Seats changed in 2022 = B0 + B1*w2_correction + B2*w1_correction + B3*w1_inoculation + quietly lasso controls

quietly lasso linear confidence_2022_w4_post college age3544 age4554 age5564 age65plus male midwest south west pid3_recode_w3 ideo5 conspiracy knowledge nonwhite polinterest mediatrust biden_rwin_w3 seats_won_fraud_2020_w3 seats_won_fraud_2022_w3 fraud2020w3_pre confidence_2020_w3 confidence_2022_w3 bidentherm trumptherm demtherm reptherm mediatherm electionofficialtherm whitetherm blacktherm, rseed(1234)
local confidence_2022_w4_pst_ctl=e(allvars_sel) 

reg confidence_2022_w4_post factcheck_w4 correction inoculation `confidence_2022_w4_pst_ctl', robust
est store conf22
est store conf22forAZ

reg confidence_2022_w4_post factcheck_w4 correction inoculation, robust
est store conf22_noc

quietly lasso linear confidence_2022_w4 college age3544 age4554 age5564 age65plus male midwest south west pid3_recode_w3 ideo5 conspiracy knowledge nonwhite polinterest mediatrust biden_rwin_w3 seats_won_fraud_2020_w3 seats_won_fraud_2022_w3 fraud2020w3_pre confidence_2020_w3 confidence_2022_w3 bidentherm trumptherm demtherm reptherm mediatherm electionofficialtherm whitetherm blacktherm, rseed(1234)
local confidence_2022_w4_pre_ctl=e(allvars_sel) 

reg confidence_2022_w4 correction inoculation `confidence_2022_w4_pre_ctl', robust
est store conf22w4orig 
est store conf22pre

forval i=1/100 {
lasso linear confidence_2022_w4 college age3544 age4554 age5564 age65plus male midwest south west pid3_recode_w3 ideo5 conspiracy knowledge nonwhite polinterest mediatrust biden_rwin_w3 seats_won_fraud_2020_w3 seats_won_fraud_2022_w3 fraud2020w3_pre confidence_2020_w3 confidence_2022_w3 bidentherm trumptherm demtherm reptherm mediatherm electionofficialtherm whitetherm blacktherm, rseed(1234)
local confidence_2022_w4_pre_ctl=e(allvars_sel) 

reg confidence_2022_w4 correction inoculation `confidence_2022_w4_pre_ctl', robust
lincom correction 
lincom inoculation
display e(N)
display `i'
}

quietly lasso linear seats_won_fraud_2022_w4_post college age3544 age4554 age5564 age65plus male midwest south west pid3_recode_w3 ideo5 conspiracy knowledge nonwhite polinterest mediatrust biden_rwin_w3 seats_won_fraud_2020_w3 seats_won_fraud_2022_w3 fraud2020w3_pre confidence_2020_w3 confidence_2022_w3 bidentherm trumptherm demtherm reptherm mediatherm electionofficialtherm whitetherm blacktherm, rseed(1234)
local seats_won_fraud_2022_w4_pst_ctl=e(allvars_sel) 

reg seats_won_fraud_2022_w4_post factcheck_w4 correction inoculation `seats_won_fraud_2022_w4_pst_ctl', robust
est store seats22
est store seats22forAZ

reg seats_won_fraud_2022_w4_post factcheck_w4 correction inoculation, robust
est store seats22_noc

quietly lasso linear seats_won_fraud_2022_w4 college age3544 age4554 age5564 age65plus male midwest south west pid3_recode_w3 ideo5 conspiracy knowledge nonwhite polinterest mediatrust biden_rwin_w3 seats_won_fraud_2020_w3 seats_won_fraud_2022_w3 fraud2020w3_pre confidence_2020_w3 confidence_2022_w3 bidentherm trumptherm demtherm reptherm mediatherm electionofficialtherm whitetherm blacktherm, rseed(1234)
local seats_won_fraud_2022_w4_pre_ctl=e(allvars_sel) 

reg seats_won_fraud_2022_w4 correction inoculation `seats_won_fraud_2022_w4_pre_ctl', robust
est store seats22w4orig
est store seats22pre

*RQ5b: Will exposure to a correction treatment debunking false claims about election fraud in Arizona (compared to a placebo condition) affect confidence in the 2020 election and beliefs about the prevalence and effects of fraud (Frequency of voter fraud, the number of seats changed by fraud, and whether Joe Biden is the rightful winner) in the 2020 election?

*RQ5b: Confidence in 2020 vote = B0 + B1*w2_correction + B2*w1_correction + B3*w1_inoculation + quietly lasso controls
*2020 fraud prevalence = B0 + B1*w2_correction + B2*w1_correction + B3*w1_inoculation + quietly lasso controls
*Seats changed in 2020 = B0 + B1*w2_correction + B2*w1_correction + B3*w1_inoculation + quietly lasso controls
*Biden rightful winner in 2020 = B0 + B1*w2_correction + B2*w1_correction + B3*w1_inoculation + quietly lasso controls

quietly lasso linear confidence_2020_w4_post college age3544 age4554 age5564 age65plus male midwest south west pid3_recode_w3 ideo5 conspiracy knowledge nonwhite polinterest mediatrust biden_rwin_w3 seats_won_fraud_2020_w3 seats_won_fraud_2022_w3 fraud2020w3_pre confidence_2020_w3 confidence_2022_w3 bidentherm trumptherm demtherm reptherm mediatherm electionofficialtherm whitetherm blacktherm, rseed(1234)
local confidence_2020_w4_pst_ctl=e(allvars_sel) 

reg confidence_2020_w4_post factcheck_w4 correction inoculation `confidence_2020_w4_pst_ctl', robust
est store conf20 

reg confidence_2020_w4_post factcheck_w4 correction inoculation, robust
est store conf20_noc

quietly lasso linear confidence_2020_w4 college age3544 age4554 age5564 age65plus male midwest south west pid3_recode_w3 ideo5 conspiracy knowledge nonwhite polinterest mediatrust biden_rwin_w3 seats_won_fraud_2020_w3 seats_won_fraud_2022_w3 fraud2020w3_pre confidence_2020_w3 confidence_2022_w3 bidentherm trumptherm demtherm reptherm mediatherm electionofficialtherm whitetherm blacktherm, rseed(1234)
local confidence_2020_w4_pre_ctl=e(allvars_sel) 

reg confidence_2020_w4 correction inoculation `confidence_2020_w4_pre_ctl', robust
est store conf20pre
est store conf20w4orig

quietly lasso linear fraud2020w4_post college age3544 age4554 age5564 age65plus male midwest south west pid3_recode_w3 ideo5 conspiracy knowledge nonwhite polinterest mediatrust biden_rwin_w3 seats_won_fraud_2020_w3 seats_won_fraud_2022_w3 fraud2020w3_pre confidence_2020_w3 confidence_2022_w3 bidentherm trumptherm demtherm reptherm mediatherm electionofficialtherm whitetherm blacktherm, rseed(1234)
local fraud2020w4_pst_ctl=e(allvars_sel) 

reg fraud2020w4_post factcheck_w4 correction inoculation `fraud2020w4_pst_ctl', robust
est store fraud20

reg fraud2020w4_post factcheck_w4 correction inoculation, robust
est store fraud20_noc

quietly lasso linear fraud2020w4_pre college age3544 age4554 age5564 age65plus male midwest south west pid3_recode_w3 ideo5 conspiracy knowledge nonwhite polinterest mediatrust biden_rwin_w3 seats_won_fraud_2020_w3 seats_won_fraud_2022_w3 fraud2020w3_pre confidence_2020_w3 confidence_2022_w3 bidentherm trumptherm demtherm reptherm mediatherm electionofficialtherm whitetherm blacktherm, rseed(1234)
local fraud2020w4_pre_ctl=e(allvars_sel) 

reg fraud2020w4_pre factcheck_w4 correction inoculation `fraud2020w4_pre_ctl', robust
est store fraud20pre
est store fraud20w4orig

quietly lasso linear seats_won_fraud_2020_w4_post college age3544 age4554 age5564 age65plus male midwest south west pid3_recode_w3 ideo5 conspiracy knowledge nonwhite polinterest mediatrust biden_rwin_w3 seats_won_fraud_2020_w3 seats_won_fraud_2022_w3 fraud2020w3_pre confidence_2020_w3 confidence_2022_w3 bidentherm trumptherm demtherm reptherm mediatherm electionofficialtherm whitetherm blacktherm, rseed(1234)
local seats_won_fraud_2020_w4_pst_ctl=e(allvars_sel) 

reg seats_won_fraud_2020_w4_post factcheck_w4 correction inoculation `seats_won_fraud_2020_w4_pst_ctl', robust
est store seats20 

reg seats_won_fraud_2020_w4_post factcheck_w4 correction inoculation, robust
est store seats20_noc

quietly lasso linear seats_won_fraud_2020_w4 college age3544 age4554 age5564 age65plus male midwest south west pid3_recode_w3 ideo5 conspiracy knowledge nonwhite polinterest mediatrust biden_rwin_w3 seats_won_fraud_2020_w3 seats_won_fraud_2022_w3 fraud2020w3_pre confidence_2020_w3 confidence_2022_w3 bidentherm trumptherm demtherm reptherm mediatherm electionofficialtherm whitetherm blacktherm, rseed(1234)
local seats_won_fraud_2020_w4_pre_ctl=e(allvars_sel) 

reg seats_won_fraud_2020_w4 factcheck_w4 correction inoculation `seats_won_fraud_2020_w4_pre_ctl', robust
est store seats20pre 
est store seats20w4orig

tab confidence_2020_w4 
tab confidence_2022_w4 
tab seats_won_fraud_2020_w4 
tab seats_won_fraud_2022_w4 
tab fraud2020w4_pre 

coefplot (maricopa, rename(factcheck_w4="maricopa")) (AZright, rename(factcheck_w4="AZright")) (conf22, rename(factcheck_w4="conf22")) (seats22, rename(factcheck_w4="seats22")) (conf20,rename(factcheck_w4="conf20")) (fraud20, rename(factcheck_w4="fraud20")) (seats20, rename(factcheck_w4="seats20")), keep(factcheck_w4) xline(0) scheme(lean1) xtitle("Treatment effect") coeflabel(maricopa  = "Maricopa fraud myth" AZright = "Hobbs wrongful winner myth" conf22 = "Confidence in 2022 election" seats22 = "Seats won by fraud in 2022" conf20 = "Confidence in 2020 election" fraud20 = "Fraud prevalence in 2020" seats20 = "Seats won by fraud in 2020") legend(off) grid(none) offset(0) headings(maricopa = "{bf:Specific: 2022 AZ GOV election}" conf22 = "{bf:General: 2022 U.S. elections}" conf20 = "{bf:General: 2020 U.S. elections}")
graph export "azcoefs.pdf", replace

estout maricopa AZright conf22 seats22 conf20 fraud20 seats20 using "azcoefs.tex", label keep(factcheck_w4 correction inoculation) style(tex) replace varwidth(25) collabels("") cells(b(star fmt(%9.3f)) se(par fmt(%9.3f))) stats(N, fmt(%9.0f) labels("N")) starlevels(* 0.05 ** 0.01 *** 0.005) 

estout maricopa_noc AZright_noc conf22_noc seats22_noc conf20_noc fraud20_noc seats20_noc using "azcoefs_noc.tex", label keep(factcheck_w4 correction inoculation) style(tex) replace varwidth(25) collabels("") cells(b(star fmt(%9.3f)) se(par fmt(%9.3f))) stats(N, fmt(%9.0f) labels("N")) starlevels(* 0.05 ** 0.01 *** 0.005) 

*Finally, we may conduct exploratory analyses of potential heterogeneous treatment effects for the following moderators for the models used to test H3, RQ5a, RQ5b: 
*-party identification
*-Trump feeling thermometer
*-pre-treatment measure of outcome (where available)
*-assignment to wave 1 treatment (correction, pre-bunking, placebo)

reg AZmaricopa_w4 factcheck_w4 correction inoculation `AZmaricopa_w4_ctl', robust
reg AZmaricopa_w4 factcheck##independent_w3##republican_w3 correction inoculation `AZmaricopa_w4_ctl', robust
est store AZmaricopa_w4_party 
reg AZmaricopa_w4 factcheck##ib1.trumpq correction inoculation `AZmaricopa_w4_ctl', robust
est store AZmaricopa_w4_trump
reg AZmaricopa_w4 factcheck##correction##inoculation `AZmaricopa_w4_ctl', robust
est store AZmaricopa_w4_w1treatment 

estout AZmaricopa_w4_party AZmaricopa_w4_trump AZmaricopa_w4_w1treatment using "AZMaricopa_w4_interactions.tex", label style(tex) replace varwidth(25) collabels("") cells(b(star fmt(%9.3f)) se(par fmt(%9.3f))) stats(N, fmt(%9.0f) labels("N")) starlevels(* 0.05 ** 0.01 *** 0.005) 

reg AZgov_rightful factcheck_w4 correction inoculation `AZgov_rightful_ctl', robust
reg AZgov_rightful factcheck##independent_w3##republican_w3 correction inoculation `AZgov_rightful_ctl', robust
est store AZgov_rightful_party
reg AZgov_rightful factcheck##ib1.trumpq correction inoculation `AZgov_rightful_ctl', robust
est store AZgov_rightful_trump
reg AZgov_rightful factcheck##correction##inoculation `AZgov_rightful_ctl', robust
est store AZgov_rightful_w1treatment

estout AZgov_rightful_party AZgov_rightful_trump AZgov_rightful_w1treatment using "AZgov_rightful_interactions.tex", label style(tex) replace varwidth(25) collabels("") cells(b(star fmt(%9.3f)) se(par fmt(%9.3f))) stats(N, fmt(%9.0f) labels("N")) starlevels(* 0.05 ** 0.01 *** 0.005) 

reg confidence_2022_w4_post factcheck_w4 correction inoculation `confidence_2022_w4_pst_ctl', robust
reg confidence_2022_w4_post factcheck##independent_w3##republican_w3 correction inoculation `confidence_2022_w4_pst_ctl', robust
est store conf2022w4postparty
reg confidence_2022_w4_post factcheck##ib1.trumpq correction inoculation `confidence_2022_w4_pst_ctl', robust
est store conf2022w4posttrump
reg confidence_2022_w4_post factcheck##ib3.conf2022q correction inoculation `confidence_2022_w4_pst_ctl', robust
est store conf2022w4postpre
reg confidence_2022_w4_post factcheck##correction##inoculation `confidence_2022_w4_pst_ctl', robust
est store conf2022w4postw1treat

estout conf2022w4post* using "confidence_2022_w4_post_interactions.tex", label style(tex) replace varwidth(25) collabels("") cells(b(star fmt(%9.3f)) se(par fmt(%9.3f))) stats(N, fmt(%9.0f) labels("N")) starlevels(* 0.05 ** 0.01 *** 0.005) 

reg seats_won_fraud_2022_w4_post factcheck_w4 correction inoculation `seats_won_fraud_2022_w4_pst_ctl', robust
reg seats_won_fraud_2022_w4_post factcheck##independent_w3##republican_w3 correction inoculation `seats_won_fraud_2022_w4_pst_ctl', robust
est store seats_fraud_2022_party
reg seats_won_fraud_2022_w4_post factcheck##ib1.trumpq correction inoculation `seats_won_fraud_2022_w4_pst_ctl', robust
est store seats_fraud_2022_trump
reg seats_won_fraud_2022_w4_post factcheck##ib1.seats_won_fraud_2022_w3 correction inoculation `seats_won_fraud_2022_w4_pst_ctl', robust
est store seats_fraud_2022_pre
reg seats_won_fraud_2022_w4_post factcheck##correction##inoculation `seats_won_fraud_2022_w4_pst_ctl', robust
est store seats_fraud_2022_w1treat

estout seats_fraud_2022* using "seats_won_fraud_2022_w4_post_interactions.tex", label style(tex) replace varwidth(25) collabels("") cells(b(star fmt(%9.3f)) se(par fmt(%9.3f))) stats(N, fmt(%9.0f) labels("N")) starlevels(* 0.05 ** 0.01 *** 0.005) 

reg confidence_2020_w4_post factcheck_w4 correction inoculation `confidence_2020_w4_pst_ctl', robust
reg confidence_2020_w4_post factcheck##independent_w3##republican_w3 correction inoculation `confidence_2020_w4_pst_ctl', robust
est store conf_2020_party
reg confidence_2020_w4_post factcheck##ib1.trumpq correction inoculation `confidence_2020_w4_pst_ctl', robust
est store conf_2020_trump
reg confidence_2020_w4_post factcheck##ib3.conf2020q correction inoculation `confidence_2020_w4_pst_ctl', robust
est store conf_2020_pre
reg confidence_2020_w4_post factcheck##correction##inoculation `confidence_2020_w4_pst_ctl', robust
est store conf_2020_w1treat

estout conf_2020_* using "confidence_2020_w4_post_interactions.tex", label style(tex) replace varwidth(25) collabels("") cells(b(star fmt(%9.3f)) se(par fmt(%9.3f))) stats(N, fmt(%9.0f) labels("N")) starlevels(* 0.05 ** 0.01 *** 0.005) 

reg fraud2020w4_post factcheck_w4 correction inoculation `fraud2020w4_pst_ctl', robust
reg fraud2020w4_post factcheck##independent_w3##republican_w3 correction inoculation `fraud2020w4_pst_ctl', robust
est store fraud2020w4_post_party
reg fraud2020w4_post factcheck##ib1.trumpq correction inoculation `fraud2020w4_pst_ctl', robust
est store fraud2020w4_post_trump
reg fraud2020w4_post factcheck##ib1.fraud2020q_w3 correction inoculation `fraud2020w4_pst_ctl', robust
est store fraud2020w4_post_pre
reg fraud2020w4_post factcheck##correction##inoculation `fraud2020w4_pst_ctl', robust
est store fraud2020w4_post_w1treat 

estout fraud2020w4_post* using "fraud2020w4_post_interactions.tex", label style(tex) replace varwidth(25) collabels("") cells(b(star fmt(%9.3f)) se(par fmt(%9.3f))) stats(N, fmt(%9.0f) labels("N")) starlevels(* 0.05 ** 0.01 *** 0.005) 

reg seats_won_fraud_2020_w4_post factcheck_w4 correction inoculation `seats_won_fraud_2020_w4_pst_ctl', robust
reg seats_won_fraud_2020_w4_post factcheck##independent_w3##republican_w3 correction inoculation `seats_won_fraud_2020_w4_pst_ctl', robust
est store seats2020w4post_party
reg seats_won_fraud_2020_w4_post factcheck##ib1.trumpq correction inoculation `seats_won_fraud_2020_w4_pst_ctl', robust
est store seats2020w4post_trump
reg seats_won_fraud_2020_w4_post factcheck##ib1.seats_won_fraud_2020_w3 correction inoculation `seats_won_fraud_2020_w4_pst_ctl', robust
est store seats2020w4post_post_pre
reg seats_won_fraud_2020_w4_post factcheck##correction##inoculation `seats_won_fraud_2020_w4_pst_ctl', robust
est store seats2020w4post_w1treat 

estout seats2020w4post* using "seats_won_fraud_2020_w4_post_interactions.tex", label style(tex) replace varwidth(25) collabels("") cells(b(star fmt(%9.3f)) se(par fmt(%9.3f))) stats(N, fmt(%9.0f) labels("N")) starlevels(* 0.05 ** 0.01 *** 0.005) 

/*no controls*/

reg AZmaricopa_w4 factcheck_w4 correction inoculation, robust
reg AZmaricopa_w4 factcheck##independent_w3##republican_w3 correction inoculation, robust
est store AZmaricopa_w4_party 
reg AZmaricopa_w4 factcheck##ib1.trumpq correction inoculation, robust
est store AZmaricopa_w4_trump
reg AZmaricopa_w4 factcheck##correction##inoculation, robust
est store AZmaricopa_w4_w1treatment 

estout AZmaricopa_w4_party AZmaricopa_w4_trump AZmaricopa_w4_w1treatment using "AZMaricopa_w4_interactions_noc.tex", label style(tex) replace varwidth(25) collabels("") cells(b(star fmt(%9.3f)) se(par fmt(%9.3f))) stats(N, fmt(%9.0f) labels("N")) starlevels(* 0.05 ** 0.01 *** 0.005) 

reg AZgov_rightful factcheck_w4 correction inoculation, robust
reg AZgov_rightful factcheck##independent_w3##republican_w3 correction inoculation, robust
est store AZgov_rightful_party
reg AZgov_rightful factcheck##ib1.trumpq correction inoculation, robust
est store AZgov_rightful_trump
reg AZgov_rightful factcheck##correction##inoculation, robust
est store AZgov_rightful_w1treatment

estout AZgov_rightful_party AZgov_rightful_trump AZgov_rightful_w1treatment using "AZgov_rightful_interactions_noc.tex", label style(tex) replace varwidth(25) collabels("") cells(b(star fmt(%9.3f)) se(par fmt(%9.3f))) stats(N, fmt(%9.0f) labels("N")) starlevels(* 0.05 ** 0.01 *** 0.005) 

reg confidence_2022_w4_post factcheck_w4 correction inoculation, robust
reg confidence_2022_w4_post factcheck##independent_w3##republican_w3 correction inoculation, robust
est store conf2022w4postparty
reg confidence_2022_w4_post factcheck##ib1.trumpq correction inoculation, robust
est store conf2022w4posttrump
reg confidence_2022_w4_post factcheck##ib3.conf2022q correction inoculation, robust
est store conf2022w4postpre
reg confidence_2022_w4_post factcheck##correction##inoculation, robust
est store conf2022w4postw1treat

estout conf2022w4post* using "confidence_2022_w4_post_interactions_noc.tex", label style(tex) replace varwidth(25) collabels("") cells(b(star fmt(%9.3f)) se(par fmt(%9.3f))) stats(N, fmt(%9.0f) labels("N")) starlevels(* 0.05 ** 0.01 *** 0.005) 

reg seats_won_fraud_2022_w4_post factcheck_w4 correction inoculation, robust
reg seats_won_fraud_2022_w4_post factcheck##independent_w3##republican_w3 correction inoculation, robust
est store seats_fraud_2022_party
reg seats_won_fraud_2022_w4_post factcheck##ib1.trumpq correction inoculation, robust
est store seats_fraud_2022_trump
reg seats_won_fraud_2022_w4_post factcheck##ib1.seats_won_fraud_2022_w3 correction inoculation, robust
est store seats_fraud_2022_pre
reg seats_won_fraud_2022_w4_post factcheck##correction##inoculation, robust
est store seats_fraud_2022_w1treat

estout seats_fraud_2022* using "seats_won_fraud_2022_w4_post_interactions_noc.tex", label style(tex) replace varwidth(25) collabels("") cells(b(star fmt(%9.3f)) se(par fmt(%9.3f))) stats(N, fmt(%9.0f) labels("N")) starlevels(* 0.05 ** 0.01 *** 0.005) 

reg confidence_2020_w4_post factcheck_w4 correction inoculation, robust
reg confidence_2020_w4_post factcheck##independent_w3##republican_w3 correction inoculation, robust
est store conf_2020_party
reg confidence_2020_w4_post factcheck##ib1.trumpq correction inoculation, robust
est store conf_2020_trump
reg confidence_2020_w4_post factcheck##ib3.conf2020q correction inoculation, robust
est store conf_2020_pre
reg confidence_2020_w4_post factcheck##correction##inoculation, robust
est store conf_2020_w1treat

estout conf_2020_* using "confidence_2020_w4_post_interactions_noc.tex", label style(tex) replace varwidth(25) collabels("") cells(b(star fmt(%9.3f)) se(par fmt(%9.3f))) stats(N, fmt(%9.0f) labels("N")) starlevels(* 0.05 ** 0.01 *** 0.005) 

reg fraud2020w4_post factcheck_w4 correction inoculation, robust
reg fraud2020w4_post factcheck##independent_w3##republican_w3 correction inoculation, robust
est store fraud2020w4_post_party
reg fraud2020w4_post factcheck##ib1.trumpq correction inoculation, robust
est store fraud2020w4_post_trump
reg fraud2020w4_post factcheck##ib1.fraud2020q_w3 correction inoculation, robust
est store fraud2020w4_post_pre
reg fraud2020w4_post factcheck##correction##inoculation, robust
est store fraud2020w4_post_w1treat 

estout fraud2020w4_post* using "fraud2020w4_post_interactions_noc.tex", label style(tex) replace varwidth(25) collabels("") cells(b(star fmt(%9.3f)) se(par fmt(%9.3f))) stats(N, fmt(%9.0f) labels("N")) starlevels(* 0.05 ** 0.01 *** 0.005) 

reg seats_won_fraud_2020_w4_post factcheck_w4 correction inoculation, robust
reg seats_won_fraud_2020_w4_post factcheck##independent_w3##republican_w3 correction inoculation, robust
est store seats2020w4post_party
reg seats_won_fraud_2020_w4_post factcheck##ib1.trumpq correction inoculation, robust
est store seats2020w4post_trump
reg seats_won_fraud_2020_w4_post factcheck##ib1.seats_won_fraud_2020_w3 correction inoculation, robust
est store seats2020w4post_post_pre
reg seats_won_fraud_2020_w4_post factcheck##correction##inoculation, robust
est store seats2020w4post_w1treat 

estout seats2020w4post* using "seats_won_fraud_2020_w4_post_interactions_noc.tex", label style(tex) replace varwidth(25) collabels("") cells(b(star fmt(%9.3f)) se(par fmt(%9.3f))) stats(N, fmt(%9.0f) labels("N")) starlevels(* 0.05 ** 0.01 *** 0.005) 

drop _merge
save "2022w2.dta", replace

*************
*2022 WAVE 3*
*************

clear
use "DART0053_W3_OUTPUT.dta"

*A typo was reported by a survey respondent in the experimental stimuli ("prevent the integrity" instead of "protect the integrity"). YouGov corrected this language in both the prebunking with inoculation and with no inoculation conditions after 70 participants had completed the study. We will therefore exclude the first 70 participants to take part in the study from all analyses of the data.

sort starttime
drop if _n<71

rename caseid caseid_orig
rename caseid_Dart0053_W1 caseid 
merge 1:1 caseid using "2022w1.dta"
tab _merge

drop condition_treat_w1

tab condition_treat _merge, row chi2 /*no evidence of differential attrition*/

drop if _merge==2
drop _merge

merge 1:1 caseid using "2022w2.dta",keepusing(fact_check_treat factcheck_w4 AZmaricopa_w4 AZgov_rightful_w4 factcheck_w4)
tab _merge

tab fact_check_treat _merge, chi2 row /*no evidence of differential attrition*/
drop if _merge==2

*The variables above pertain to condition assignment in Waves 1 and 2. For Wave 3, we will create a prebunking with inoculation treatment assignment variable that takes the value of 1 for respondents who are assigned to the prebunking with inoculation treatment condition and 0 otherwise and a prebunking with no inoculation treatment variable that takes the value of 1 for respondents who are assigned to the prebunking with no inoculation treatment condition and 0 otherwise.

gen prebunking_inoc=(condition_treat==2)
gen prebunking_no_inoc=(condition_treat==1)

***Outcome Vars - PRE-TREATMENT***

*How many seats will be won by fraud in 2022*
tab Q22b_w5 
rename Q22b_w5 seats_won_fraud_2022_w5
label var seats_won_fraud_2022_w5 "Number of Seats Will be Won b/c Fraud 2022 - W5 PRE"
codebook seats_won_fraud_2022_w5

*How many seats will be won by fraud in 2024*
tab Q22c_w5 
rename Q22c_w5 seats_won_fraud_2024_w5
label var seats_won_fraud_2024_w5 "Number of Seats Will be Won b/c Fraud 2024 - W5 PRE"
codebook seats_won_fraud_2024_w5

*2022 confidence

*Confidence your vote will be counted as intended: four-point scale from very confident (4) to not at all confident (1).
tab Q22a_1_w5
rename Q22a_1_w5 conf_yrvote_2022_w5
label var conf_yrvote_2022_w5 "Confidence Your Vote Will Be Counted as Intended 2022 - w5 - PRE"
codebook conf_yrvote_2022_w5

*Confidence votes locally will be counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q22a_2_w5
rename Q22a_2_w5 conf_locvote_2022_w5
label var conf_locvote_2022_w5 "Confidence Votes Locally Will Be Counted as Intended 2022 - w5 - PRE"
codebook conf_locvote_2022_w5

*Confidence votes statewide will be counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q22a_3_w5
rename Q22a_3_w5 conf_stvote_2022_w5
label var conf_stvote_2022_w5 "Confidence Votes in State Will Be Counted as Intended 2022 - w5 - PRE"
codebook conf_stvote_2022_w5

*Confidence votes nationwide will be counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q22a_4_w5
rename Q22a_4_w5 conf_natlvote_2022_w5
label var conf_natlvote_2022_w5 "Confidence Votes Nationally Counted as Intended 2022 - w5 - PRE"
codebook conf_natlvote_2022_w5

*Confidence in 2022 election scale: Mean of responses to four items (each measured 4=very confident to 1=not at all confident):
*-Your vote
*-Votes locally
*-Votes in your state
*-Votes nationwide
egen confidence_2022_w5=rowmean(conf_yrvote_2022_w5 conf_locvote_2022_w5 conf_stvote_2022_w5 conf_natlvote_2022_w5)

factor conf_yrvote_2022_w5 conf_locvote_2022_w5 conf_stvote_2022_w5 conf_natlvote_2022_w5, pcf

*2022 fraud

tab Q42h_1_w5
vreverse Q42h_1_w5, gen(vf_22_doublevoting_w5)
label var vf_22_doublevoting_w5 "2022 VF Frequency - Double Voting - w5 - PRE"
codebook vf_22_doublevoting_w5

tab Q42h_2_w5
vreverse Q42h_2_w5, gen(vf_22_stealballots_w5)
label var vf_22_stealballots_w5 "2022 VF Frequency - Stealing/Tampering Ballots - w5 - PRE"
codebook vf_22_stealballots_w5

tab Q42h_3_w5
vreverse Q42h_3_w5, gen(vf_22_voterimpers_w5)
label var vf_22_voterimpers_w5 "2022 VF Frequency - Voter Impersonation - w5 - PRE"
codebook vf_22_voterimpers_w5

tab Q42h_4_w5
vreverse Q42h_4_w5, gen(vf_22_noncitz_voting_w5)
label var vf_22_noncitz_voting_w5 "2022 VF Frequency - Non-Citizen Voting - w5 - PRE"
codebook vf_22_noncitz_voting_w5

tab Q42h_5_w5
vreverse Q42h_5_w5, gen(vf_22_abstfraud_w5)
label var vf_22_abstfraud_w5 "2022 VF Frequency - Absentee Ballot Fraud - w5 - PRE"
codebook vf_22_abstfraud_w5
	
tab Q42h_6_w5
vreverse Q42h_6_w5, gen(vf_22_offic_fraud_w5)
label var vf_22_offic_fraud_w5 "2022 VF Frequency - Officials Preventing Absentee Vote - w5 - PRE"
codebook vf_22_offic_fraud_w5

*Voter fraud in 2022 beliefs Frequency scale: Mean of responses to six items (each measured 7=a million or more to 1=less than ten):
*-Voting more than once in an election.
*-Stealing or tampering with ballots.
*-Pretending to be someone else when voting.
*-People voting who are not U.S. citizens.
*-Voting with an absentee ballot intended for another person.
*-Officials preventing absentee voters from voting.
egen fraud2022w5_pre=rowmean(vf_22_doublevoting_w5 vf_22_stealballots_w5 vf_22_voterimpers_w5 vf_22_noncitz_voting_w5 vf_22_abstfraud_w5 vf_22_offic_fraud_w5)
codebook fraud2022w5_pre

factor vf_22_doublevoting_w5 vf_22_stealballots_w5 vf_22_voterimpers_w5 vf_22_noncitz_voting_w5 vf_22_abstfraud_w5 vf_22_offic_fraud_w5, pcf

/* Maricopa County

On Election Day, a printing malfunction took place at about one-quarter of the polling places in Maricopa County, the most populous county in Arizona. This problem stopped some ballots from being counted onsite.
 
Please indicate whether you believe the following statement is accurate or not.
Only voting sites in conservative areas in Arizona's Maricopa County experienced issues with tabulating ballots on Election Day. */

*Statement/answer categories are worded such that saying "accurate" is a misperception, so coding is flipped so that the a fact-checking intervention that works would be negative (it reduces misperceptions) to avoid weird conflation of accuracy of underlying claim with "accurate" in answer categories 

gen AZmaricopa_w5=Q44_w5
recode AZmaricopa_w5 (4=1) (3=2) (2=3) (1=4)

/* Katie Hobbs won due to fraud */

*In the election for Arizona governor, Katie Hobbs, the Democrat, defeated Kari Lake, the Republican, due to election fraud and is NOT the rightful winner.

*Statement/answer categories are worded such that saying "agree" is a misperception, so coding is flipped so that the a fact-checking intervention that works would be negative (it reduces misperceptions) to be avoid switching signs from previous question 

gen AZgov_rightful_w5=Q45_w5
recode AZgov_rightful_w5 (4=1) (3=2) (2=3) (1=4)

*2024 confidence

*Confidence your vote will be counted as intended: four-point scale from very confident (4) to not at all confident (1).
tab Q42a_1_w5
rename Q42a_1_w5 conf_yrvote_2024_w5
label var conf_yrvote_2024_w5 "Confidence Your Vote Will Be Counted as Intended 2024 - w5 - PRE"
codebook conf_yrvote_2024_w5

*Confidence votes locally will be counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q42a_2_w5
rename Q42a_2_w5 conf_locvote_2024_w5
label var conf_locvote_2024_w5 "Confidence Votes Locally Will Be Counted as Intended 2024 - w5 - PRE"
codebook conf_locvote_2024_w5

*Confidence votes statewide will be counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q42a_3_w5
rename Q42a_3_w5 conf_stvote_2024_w5
label var conf_stvote_2024_w5 "Confidence Votes in State Will Be Counted as Intended 2024 - w5 - PRE"
codebook conf_stvote_2024_w5

*Confidence votes nationwide will be counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q42a_4_w5
rename Q42a_4_w5 conf_natlvote_2024_w5
label var conf_natlvote_2024_w5 "Confidence Votes Nationally Counted as Intended 2024 - w5 - PRE"
codebook conf_natlvote_2024_w5

*Confidence in 2024 election scale: Mean of responses to four items (each measured 4=very confident to 1=not at all confident):
*-Your vote
*-Votes locally
*-Votes in your state
*-Votes nationwide
egen confidence_2024_w5=rowmean(conf_yrvote_2024_w5 conf_locvote_2024_w5 conf_stvote_2024_w5 conf_natlvote_2024_w5)

factor conf_yrvote_2024_w5 conf_locvote_2024_w5 conf_stvote_2024_w5 conf_natlvote_2024_w5, pcf

*2024 fraud
tab Q42d_1_w5
vreverse Q42d_1_w5, gen(vf_24_doublevoting_w5)
label var vf_24_doublevoting_w5 "2024 VF Frequency - Double Voting - w5 - PRE"
codebook vf_24_doublevoting_w5

tab Q42d_2_w5
vreverse Q42d_2_w5, gen(vf_24_stealballots_w5)
label var vf_24_stealballots_w5 "2024 VF Frequency - Stealing/Tampering Ballots - w5 - PRE"
codebook vf_24_stealballots_w5

tab Q42d_3_w5
vreverse Q42d_3_w5, gen(vf_24_voterimpers_w5)
label var vf_24_voterimpers_w5 "2024 VF Frequency - Voter Impersonation - w5 - PRE"
codebook vf_24_voterimpers_w5

tab Q42d_4_w5
vreverse Q42h_4_w5, gen(vf_24_noncitz_voting_w5)
label var vf_24_noncitz_voting_w5 "2024 VF Frequency - Non-Citizen Voting - w5 - PRE"
codebook vf_24_noncitz_voting_w5

tab Q42d_5_w5
vreverse Q42d_5_w5, gen(vf_24_abstfraud_w5)
label var vf_24_abstfraud_w5 "2024 VF Frequency - Absentee Ballot Fraud - w5 - PRE"
codebook vf_24_abstfraud_w5
	
tab Q42d_6_w5
vreverse Q42d_6_w5, gen(vf_24_offic_fraud_w5)
label var vf_24_offic_fraud_w5 "2024 VF Frequency - Officials Preventing Absentee Vote - w5 - PRE"
codebook vf_24_offic_fraud_w5

*Voter fraud in 2024 beliefs Frequency scale: Mean of responses to six items (each measured 7=a million or more to 1=less than ten):
*-Voting more than once in an election.
*-Stealing or tampering with ballots.
*-Pretending to be someone else when voting.
*-People voting who are not U.S. citizens.
*-Voting with an absentee ballot intended for another person.
*-Officials preventing absentee voters from voting.
egen fraud2024w5_pre=rowmean(vf_24_doublevoting_w5 vf_24_stealballots_w5 vf_24_voterimpers_w5 vf_24_noncitz_voting_w5 vf_24_abstfraud_w5 vf_24_offic_fraud_w5)
codebook fraud2024w5_pre

factor vf_24_doublevoting_w5 vf_24_stealballots_w5 vf_24_voterimpers_w5 vf_24_noncitz_voting_w5 vf_24_abstfraud_w5 vf_24_offic_fraud_w5, pcf

*Belief in targeted false claims (each measured on a scale from 1=not at all accurate to 4=very accurate):

*-More votes in one contest than other contests on the ballot means that results cannot be trusted. 

vreverse Q43_1_w5, gen(targeted_false1_w5_pre)

*-If results as reported on election night change over the ensuing days or weeks, the process is hacked or compromised. 

vreverse Q43_2_w5, gen(targeted_false2_w5_pre)

*DEVIATION/NOT SPECIFIED IN PREREG EXPLICITLY
egen targeted_false_w5_pre=rowmean(targeted_false1_w5_pre targeted_false2_w5_pre)

*non-targeted false claims
*-Votes are regularly being cast on behalf of dead people. ***WORDING UPDATED FROM PREREG

vreverse Q43_3_w5, gen(non_targeted_false1_w5_pre)

*-Voting system software is not reviewed or tested and can be easily manipulated. 

vreverse Q43_4_w5, gen(non_targeted_false2_w5_pre)

*-If there are problems with voting machines at a voting site, the votes from that site will not be counted. 

vreverse Q43_5_w5, gen(non_targeted_false3_w5_pre)

*-Poll workers intentionally give specific writing instruments, such as Sharpies, only to specific voters to cause their ballots to be rejected.

vreverse Q43_6_w5, gen(non_targeted_false4_w5_pre)

egen non_targeted_false_w5_pre=rowmean(non_targeted_false1_w5_pre non_targeted_false2_w5_pre non_targeted_false3_w5_pre non_targeted_false4_w5_pre)
 
*targeted true claims
*-Procedures for casting and counting ballots prevent election officials from knowing which candidates an individual voted for. ***REPLACED PER PREREG UPDATE

vreverse Q43_7_w5, gen(targeted_true1_w5_pre)

*-Ballot handling procedures protect against intentional or unintentional ballot destruction and related tampering. 

vreverse Q43_8_w5, gen(targeted_true2_w5_pre)

egen targeted_true_w5_pre=rowmean(targeted_true1_w5_pre targeted_true2_w5_pre)

*non-targeted true claims
*-Robust safeguards protect against tampering with ballots returned via drop box. 

vreverse Q43_9_w5, gen(non_targeted_true1_w5_pre)

*-Safeguards protect the integrity of the mail-in/absentee ballot process.

vreverse Q43_10_w5, gen(non_targeted_true2_w5_pre)

*-Legal protections guard against the removal of eligible voters during updates of registration lists by election officials.***WORDING UPDATED FROM PREREG

vreverse Q43_11_w5, gen(non_targeted_true3_w5_pre)

*-Voters are protected by state and federal law from threats or intimidation at the polls, including from election observers.

vreverse Q43_12_w5, gen(non_targeted_true4_w5_pre)

egen nontargeted_true_w5_pre=rowmean(non_targeted_true1_w5_pre non_targeted_true2_w5_pre non_targeted_true3_w5_pre non_targeted_true4_w5_pre)

***Outcome Vars - POST-TREATMENT***

*2022 confidence
*Confidence your vote will be counted as intended: four-point scale from very confident (4) to not at all confident (1).
tab Q42e_1_w5
rename Q42e_1_w5 conf_yrvote_2022_w5_post
label var conf_yrvote_2022_w5_post "Confidence Your Vote Will Be Counted as Intended 2022 - w5 - POST"
codebook conf_yrvote_2022_w5_post

*Confidence votes locally will be counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q42e_2_w5
rename Q42e_2_w5 conf_locvote_2022_w5_post
label var conf_locvote_2022_w5_post "Confidence Votes Locally Will Be Counted as Intended 2022 - w5 - POST"
codebook conf_locvote_2022_w5_post

*Confidence votes statewide will be counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q42e_3_w5
rename Q42e_3_w5 conf_stvote_2022_w5_post
label var conf_stvote_2022_w5_post "Confidence Votes in State Will Be Counted as Intended 2022 - w5 - POST"
codebook conf_stvote_2022_w5_post

*Confidence votes nationwide will be counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q42e_4_w5
rename Q42e_4_w5 conf_natlvote_2022_w5_post
label var conf_natlvote_2022_w5_post "Confidence Votes Nationally Will Be Counted as Intended 2022 - w5 - POST"
codebook conf_natlvote_2022_w5_post

*Confidence in 2022 election scale: Mean of responses to four items (each measured 4=very confident to 1=not at all confident):
*-Your vote
*-Votes locally
*-Votes in your state
*-Votes nationwide
egen confidence_2022_w5_post=rowmean(conf_yrvote_2022_w5_post conf_locvote_2022_w5_post conf_stvote_2022_w5_post conf_natlvote_2022_w5_post)

factor conf_yrvote_2022_w5_post conf_locvote_2022_w5_post conf_stvote_2022_w5_post conf_natlvote_2022_w5_post, pcf

*Voter Fraud 2022 Beliefs Frequency Scale - 2022 w5
/*Voter fraud in 2022 beliefs Frequency scale: Mean of responses to six items (each measured 7=a million or more to 1=less than ten):
-Voting more than once in an election.
-Stealing or tampering with ballots.
-Pretending to be someone else when voting.
-People voting who are not U.S. citizens.
-Voting with an absentee ballot intended for another person.
-Officials preventing absentee voters from voting.*/
tab Q42f_1_w5
vreverse Q42f_1_w5, gen(vf_22_doublevoting_w5_post)
label var vf_22_doublevoting_w5_post "2022 VF Frequency - Double Voting - w5 - POST"
codebook vf_22_doublevoting_w5_post

tab Q42f_2_w5
vreverse Q42f_2_w5, gen(vf_22_stealballots_w5_post)
label var vf_22_stealballots_w5_post "2022 VF Frequency - Stealing/Tampering Ballots - w5 - POST"
codebook vf_22_stealballots_w5_post

tab Q42f_3_w5
vreverse Q42f_3_w5, gen(vf_22_voterimpers_w5_post)
label var vf_22_voterimpers_w5_post "2022 VF Frequency - Voter Impersonation - w5 - POST"
codebook vf_22_voterimpers_w5_post

tab Q42f_4_w5
vreverse Q42f_4_w5, gen(vf_22_noncitz_voting_w5_post)
label var vf_22_noncitz_voting_w5_post "2022 VF Frequency - Non-Citizen Voting - w5 - POST"
codebook vf_22_noncitz_voting_w5_post

tab Q42f_5_w5
vreverse Q42f_5_w5, gen(vf_22_abstfraud_w5_post)
label var vf_22_abstfraud_w5_post "2022 VF Frequency - Absentee Ballot Fraud - w5 - POST"
codebook vf_22_abstfraud_w5_post
	
tab Q42f_6_w5
vreverse Q42f_6_w5, gen(vf_22_offic_fraud_w5_post)
label var vf_22_offic_fraud_w5_post "2022 VF Frequency - Officials Preventing Absentee Vote - w5 - POST"
codebook vf_22_offic_fraud_w5_post

*Voter fraud in 2022 beliefs Frequency scale: Mean of responses to six items (each measured 7=a million or more to 1=less than ten):
*-Voting more than once in an election.
*-Stealing or tampering with ballots.
*-Pretending to be someone else when voting.
*-People voting who are not U.S. citizens.
*-Voting with an absentee ballot intended for another person.
*-Officials preventing absentee voters from voting.
egen fraud2022w5_post=rowmean(vf_22_doublevoting_w5_post vf_22_stealballots_w5_post vf_22_voterimpers_w5_post vf_22_noncitz_voting_w5_post vf_22_abstfraud_w5_post vf_22_offic_fraud_w5_post)
codebook fraud2022w5_post 

factor vf_22_doublevoting_w5_post vf_22_stealballots_w5_post vf_22_voterimpers_w5_post vf_22_noncitz_voting_w5_post vf_22_abstfraud_w5_post vf_22_offic_fraud_w5_post, pcf

*How many seats won by fraud in 2022*/
tab Q48b_w5 
rename Q48b_w5 seats_won_fraud_2022_w5_post
label var seats_won_fraud_2022_w5_post "Number of Seats Won b/c Fraud 2022 - POST"
codebook seats_won_fraud_2022_w5_post

*2024 confidence

*Confidence your vote counted as intended: four-point scale from very confident (4) to not at all confident (1).
tab Q42b_1_w5
rename Q42b_1_w5 conf_yrvote_w5_post
label var conf_yrvote_w5_post "Confidence Your Vote Counted as Intended 2024 - w5 - POST"
codebook conf_yrvote_w5_post

*Confidence votes locally counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q42b_2_w5
rename Q42b_2_w5 conf_locvote_w5_post
label var conf_locvote_w5_post "Confidence Votes Locally Counted as Intended 2024 - w5 - POST"
codebook conf_locvote_w5_post

*Confidence votes nationwide counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q42b_3_w5
rename Q42b_3_w5 conf_stvote_w5_post
label var conf_stvote_w5_post "Confidence Votes in State Counted as Intended 2024 - w5 - POST"
codebook conf_stvote_w5_post

*Confidence votes nationwide counted as voters intended: four-point scale from very confident (4) to not at all confident (1).
tab Q42b_4_w5
rename Q42b_4_w5 conf_natlvote_w5_post
label var conf_natlvote_w5_post "Confidence Votes Nationally Counted as Intended 2024 - w5 - POST"
codebook conf_natlvote_w5_post

*Confidence in 2024 election scale: Mean of responses to four items (each measured 4=very confident to 1=not at all confident):
*-Your vote
*-Votes locally
*-Votes in your state
*-Votes nationwide
egen confidence_2024_w5_post=rowmean(conf_yrvote_w5_post conf_locvote_w5_post conf_stvote_w5_post conf_natlvote_w5_post)

factor conf_yrvote_w5_post conf_locvote_w5_post conf_stvote_w5_post conf_natlvote_w5_post, pcf

*Voter Fraud 2024 Beliefs Frequency Scale - 2024 w5
/*Voter fraud in 2024 beliefs frequency scale: Mean of responses to six items (each measured 7=a million or more to 1=less than ten):
-Voting more than once in an election.
-Stealing or tampering with ballots.
-Pretending to be someone else when voting.
-People voting who are not U.S. citizens.
-Voting with an absentee ballot intended for another person.
-Officials preventing absentee voters from voting.*/
tab Q42g_1_w5
vreverse Q42g_1_w5, gen(vf_24_doublevoting_w5_post)
label var vf_24_doublevoting_w5_post "2024 VF FreQuency - Double Voting - w5 - POST"
codebook vf_24_doublevoting_w5_post

tab Q42g_2_w5
vreverse Q42g_2_w5, gen(vf_24_stealballots_w5_post)
label var vf_24_stealballots_w5_post "2024 VF FreQuency - Stealing/Tampering Ballots - w5 - POST"
codebook vf_24_stealballots_w5_post

tab Q42g_3_w5
vreverse Q42g_3_w5, gen(vf_24_voterimpers_w5_post)
label var vf_24_voterimpers_w5_post "2024 VF FreQuency - Voter Impersonation - w5 - POST"
codebook vf_24_voterimpers_w5_post

tab Q42g_4_w5
vreverse Q42g_4_w5, gen(vf_24_noncitz_voting_w5_post)
label var vf_24_noncitz_voting_w5_post "2024 VF FreQuency - Non-Citizen Voting - w5 - POST"
codebook vf_24_noncitz_voting_w5_post

tab Q42g_5_w5
vreverse Q42g_5_w5, gen(vf_24_abstfraud_w5_post)
label var vf_24_abstfraud_w5_post "2024 VF FreQuency - Absentee Ballot Fraud - w5 - POST"
codebook vf_24_abstfraud_w5_post
	
tab Q42g_6_w5
vreverse Q42g_6_w5, gen(vf_24_offic_fraud_w5_post)
label var vf_24_offic_fraud_w5_post "2024 VF FreQuency - Officials Preventing Absentee Vote - w5 - POST"
codebook vf_24_offic_fraud_w5_post

*Voter fraud in 2024 beliefs frequency scale: Mean of responses to six items (each measured 7=a million or more to 1=less than ten):
*-Voting more than once in an election.
*-Stealing or tampering with ballots.
*-Pretending to be someone else when voting.
*-People voting who are not U.S. citizens.
*-Voting with an absentee ballot intended for another person.
*-Officials preventing absentee voters from voting.
egen fraud2024w5_post=rowmean(vf_24_doublevoting_w5_post vf_24_stealballots_w5_post vf_24_voterimpers_w5_post vf_24_noncitz_voting_w5_post vf_24_abstfraud_w5_post vf_24_offic_fraud_w5_post)
codebook fraud2024w5_post 

factor vf_24_doublevoting_w5_post vf_24_stealballots_w5_post vf_24_voterimpers_w5_post vf_24_noncitz_voting_w5_post vf_24_abstfraud_w5_post vf_24_offic_fraud_w5_post, pcf

*How many seats will be won by fraud in 2024*
tab Q48c_w5 
rename Q48c_w5 seats_won_fraud_2024_w5_post
label var seats_won_fraud_2024_w5_post "Number of Seats Will Be Won b/c Fraud 2024 - POST"
codebook seats_won_fraud_2024_w5_post

*accuracy items

*Belief in targeted false claims (each measured on a scale from 1=not at all accurate to 4=very accurate):

*-More votes in one contest than other contests on the ballot means that results cannot be trusted. 

vreverse Q45_1_w5, gen(targeted_false1_w5_post)

*-If results as reported on election night change over the ensuing days or weeks, the process is hacked or compromised. 

vreverse Q45_2_w5, gen(targeted_false2_w5_post)

*DEVIATION/NOT SPECIFIED IN PREREG EXPLICITLY
egen targeted_false_w5_post=rowmean(targeted_false1_w5_post targeted_false2_w5_post)

*non-targeted false claims
*-Votes are regularly being cast on behalf of dead people. ***WORDING UPDATED FROM PREREG

vreverse Q45_3_w5, gen(non_targeted_false1_w5_post)

*-Voting system software is not reviewed or tested and can be easily manipulated. 

vreverse Q45_4_w5, gen(non_targeted_false2_w5_post)

*-If there are problems with voting machines at a voting site, the votes from that site will not be counted. 

vreverse Q45_5_w5, gen(non_targeted_false3_w5_post)

*-Poll workers intentionally give specific writing instruments, such as Sharpies, only to specific voters to cause their ballots to be rejected.

vreverse Q45_6_w5, gen(non_targeted_false4_w5_post)

egen non_targeted_false_w5_post=rowmean(non_targeted_false1_w5_post non_targeted_false2_w5_post non_targeted_false3_w5_post non_targeted_false4_w5_post)
 
*targeted true claims
*-Procedures for casting and counting ballots prevent election officials from knowing which candidates an individual voted for. ***REPLACED PER PREREG UPDATE

vreverse Q45_7_w5, gen(targeted_true1_w5_post)

*-Ballot handling procedures protect against intentional or unintentional ballot destruction and related tampering. 

vreverse Q45_8_w5, gen(targeted_true2_w5_post)

egen targeted_true_w5_post=rowmean(targeted_true1_w5_post targeted_true2_w5_post)

*non-targeted true claims
*-Robust safeguards protect against tampering with ballots returned via drop box. 

vreverse Q45_9_w5, gen(non_targeted_true1_w5_post)

*-Safeguards protect the integrity of the mail-in/absentee ballot process.

vreverse Q45_10_w5, gen(non_targeted_true2_w5_post)

*-Legal protections guard against the removal of eligible voters during updates of registration lists by election officials.***WORDING UPDATED FROM PREREG

vreverse Q45_11_w5, gen(non_targeted_true3_w5_post)

*-Voters are protected by state and federal law from threats or intimidation at the polls, including from election observers.

vreverse Q45_12_w5, gen(non_targeted_true4_w5_post)

egen nontargeted_true_w5_post=rowmean(non_targeted_true1_w5_post non_targeted_true2_w5_post non_targeted_true3_w5_post non_targeted_true4_w5_post)

*demos
tab educ
tab gender
tab pid7
tab race
su birthyr, detail

drop agegroup noncollege party3 

gen agegroup=.
replace agegroup=1 if age1834==1
replace agegroup=2 if age3544==1
replace agegroup=3 if age4554==1
replace agegroup=4 if age5564==1
replace agegroup=5 if age65plus==1

label drop agelab
label def agelab 1 "18-34" 2 "35-44" 3 "45-54" 4 "55-64" 5 "65+"
label val agegroup agelab

gen noncollege=(educ<5) if educ!=.

label drop noncollegelab
label def noncollegelab 0 "College degree" 1 "No college degree"
label val noncollege noncollegelab

label drop nonwhitelab
label def nonwhitelab 0 "White" 1 "Non-white"
label val nonwhite_w3 nonwhitelab

gen party3=.
replace party3=1 if pid7<4
replace party3=2 if pid7==4 | pid7==8
replace party3=3 if pid7>4 & pid7<8

label drop partylab
label def partylab 1 "Democrat" 2 "Independent" 3 "Republican"
label val party3 partylab

gen condition_w5=0
replace condition_w5=1 if prebunking_inoc==1
replace condition_w5=2 if prebunking_no_inoc==1

dtable i.gender i.agegroup i.noncollege i.nonwhite_w3 i.party3, by(condition_w5) export(study3-descriptives.tex, replace) fvlabel

*RQ8: Do the treatment effects from the Arizona correction administered in Wave 2 persist in Wave 3? (i.e., are any effects measurable in Wave 3 for H3, RQ5a, or RQ5b?)

*We will repeat the analyses specified above for H3, RQ5a, and RQ5b among participants in Wave 3.

quietly lasso linear AZmaricopa_w5 college age3544 age4554 age5564 age65plus male midwest south west pid3_recode_w3 ideo5 conspiracy knowledge nonwhite polinterest mediatrust biden_rwin_w3 seats_won_fraud_2020_w3 seats_won_fraud_2022_w3 fraud2020w3_pre confidence_2020_w3 confidence_2022_w3 bidentherm trumptherm demtherm reptherm mediatherm electionofficialtherm whitetherm blacktherm, rseed(1234)
local AZmaricopa_w5_ctl=e(allvars_sel) 

reg AZmaricopa_w5 factcheck_w4 correction inoc `AZmaricopa_w5_ctl', robust
est store maricopa2

reg AZmaricopa_w5 factcheck_w4 correction inoc, robust
est store maricopa2_noc

bysort factcheck_w4: su AZmaricopa_w5

quietly lasso linear AZgov_rightful_w5 college age3544 age4554 age5564 age65plus male midwest south west pid3_recode_w3 ideo5 conspiracy knowledge nonwhite polinterest mediatrust biden_rwin_w3 seats_won_fraud_2020_w3 seats_won_fraud_2022_w3 fraud2020w3_pre confidence_2020_w3 confidence_2022_w3 bidentherm trumptherm demtherm reptherm mediatherm electionofficialtherm whitetherm blacktherm, rseed(1234)
local AZgov_rightful_w5_ctl=e(allvars_sel) 

reg AZgov_rightful_w5 factcheck_w4 correction inoc `AZgov_rightful_w5_ctl', robust
est store AZright2

reg AZgov_rightful_w5 factcheck_w4 correction inoc, robust
est store AZright2_noc

quietly lasso linear confidence_2022_w5 college age3544 age4554 age5564 age65plus male midwest south west pid3_recode_w3 ideo5 conspiracy knowledge nonwhite polinterest mediatrust biden_rwin_w3 seats_won_fraud_2020_w3 seats_won_fraud_2022_w3 fraud2020w3_pre confidence_2020_w3 confidence_2022_w3 bidentherm trumptherm demtherm reptherm mediatherm electionofficialtherm whitetherm blacktherm, rseed(1234)
local confidence_2022_w5_ctl=e(allvars_sel) 

reg confidence_2022_w5 factcheck_w4 correction inoculation `confidence_2022_w5_ctl', robust
est store conf222

reg confidence_2022_w5 factcheck_w4 correction inoculation, robust
est store conf222_noc

quietly lasso linear seats_won_fraud_2022_w5 college age3544 age4554 age5564 age65plus male midwest south west pid3_recode_w3 ideo5 conspiracy knowledge nonwhite polinterest mediatrust biden_rwin_w3 seats_won_fraud_2020_w3 seats_won_fraud_2022_w3 fraud2020w3_pre confidence_2020_w3 confidence_2022_w3 bidentherm trumptherm demtherm reptherm mediatherm electionofficialtherm whitetherm blacktherm, rseed(1234)
local seats_won_fraud_2022_w5_ctl=e(allvars_sel) 

reg seats_won_fraud_2022_w5 factcheck_w4 correction inoculation `seats_won_fraud_2022_w5_ctl', robust
est store seats222

reg seats_won_fraud_2022_w5 factcheck_w4 correction inoculation, robust
est store seats222_noc

estout maricopa maricopa2 AZright AZright2 conf22forAZ conf222 seats22forAZ seats222 using "azcoefs-both.tex", label keep(factcheck_w4) style(tex) replace varwidth(25) collabels("") cells(b(star fmt(%9.3f)) se(par fmt(%9.3f))) stats(N, fmt(%9.0f) labels("N")) starlevels(* 0.05 ** 0.01 *** 0.005) 

estout maricopa_noc maricopa2_noc AZright_noc AZright2_noc conf22_noc conf222_noc seats22_noc seats222_noc using "azcoefs-both-noc.tex", label keep(factcheck_w4) style(tex) replace varwidth(25) collabels("") cells(b(star fmt(%9.3f)) se(par fmt(%9.3f))) stats(N, fmt(%9.0f) labels("N")) starlevels(* 0.05 ** 0.01 *** 0.005) 

coefplot (maricopa, offset(0.1) rename(factcheck_w4="maricopa") msymbol(circle) mcolor(black)) (maricopa2, offset(-0.1) rename(factcheck_w4="maricopa")   msymbol(Dh) mcolor(black)) (AZright, offset(0.1) rename(factcheck_w4="AZright") msymbol(circle) mcolor(black)) (AZright2, offset(-0.1) rename(factcheck_w4="AZright") msymbol(Dh) mcolor(black)) (conf22forAZ, offset(0.1) rename(factcheck_w4="conf22") msymbol(circle) mcolor(black)) (conf222, offset(-0.1) rename(factcheck_w4="conf22") msymbol(Dh) mcolor(black)) (seats22forAZ, offset(0.1) rename(factcheck_w4="seats22") msymbol(circle) mcolor(black)) (seats22, offset(-0.1) rename(factcheck_w4="seats22") msymbol(Dh) mcolor(black)), keep(factcheck_w4) xline(0) scheme(lean1) xtitle("Treatment effect") coeflabel(maricopa  = "Maricopa fraud myth" AZright = "Hobbs wrongful winner myth" conf22 = "Confidence in 2022 election" seats22 = "Seats won by fraud in 2022") grid(none) offset(0) headings(maricopa = "{bf:Specific: 2022 AZ GOV election}" conf22 = "{bf:General: 2022 U.S. elections}") legend(lab(2 "Treatment wave") lab(4 "Post-treatment wave") order(2 4) pos(7) ring(0) region(lstyle(foregrond)))
graph export "azcoefs-both.pdf", replace
